Vcst restapi phase2 hygiene#139
Merged
Merged
Conversation
…arker, tautological tests platform/test_assets.py: - wrap 6 tests in try/finally with folder cleanup (test_asset_upload_url/_image/_local, test_asset_file_access, test_asset_file_access_after_delete, test_asset_folder_create, test_asset_folder_delete, test_asset_folder_create_delete_bulk) - add module-level _GITHUB_SAMPLE_URL constants and _delete_folder_safe helper - replace verify=False with global_settings.verify_ssl on raw requests.get call platform/test_misc.py + search/test_search.py: - add @pytest.mark.destructive to test_restart_platform and test_index_drop - register destructive marker in pyproject.toml - move `import time` to top of module (test_misc) platform/test_dynamic_properties.py: - wrap verify/cleanup in try/finally across 3 parametrized test functions so properties are cleaned up even on assertion failure - test_dynamic_property_value_types now asserts valueType matches catalog_personalisation/test_personalisation.py: - replace bare `try: ... except Exception: pass` with `pytest.raises(HTTPError)` → `pytest.skip` on unsupported endpoint (4 tests: put_assign_product, put_assign_category, put_unassign_product, outlines_sync) - tighten tautological `assert result is not None` assertions to structural checks (isinstance dict/list, has totalCount/results) .github/workflows/restapi-tests-docker.yml: - parallel stage: add `and not destructive` filter - serial stage: add `and not destructive`, drop --deselect hack for test_restart_platform (marker now handles it) Results: 259 passed, 5 skipped, 2 destructive deselected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ure, assertion tightening Type hints: - add `-> None` to 243 test function signatures across 38 files Fixtures: - add `seed_catalog` (full dict) and `seed_catalog_id` (str) session fixtures in tests/restapi/conftest.py, reading from dataset - replace hardcoded "catalog-acme" in pricing/conftest.py (make_assignment), pricing/test_assignments.py (2 sites), and catalog_publishing/test_publishing.py (5 sites) - platform/conftest.py: reverse teardown order in make_role and make_oauth_client to match sibling modules Assertion tightening: - content/test_content.py: drop `assert result is not None or True` tautology - core/test_core.py: test_currency_update and test_package_update now verify post-PUT via GET; test_seo_info_get uses HTTPError -> skip and structural check instead of `or True` - pricing/test_pricelist.py: `len(items) >= 0` -> `isinstance(items, list)` - contacts/test_vendor.py: `totalCount >= 0` -> isinstance int/list - health_check/test_health.py: tautological `or response.status_code == 200` removed; elastic verify uses `isinstance(list)` - catalog_publishing/test_publishing.py: bare try/except on evaluate replaced with HTTPError -> skip; add finally cleanup on channel tests Imports / dead code: - contacts/conftest.py: remove unused ADDRESS_TEMPLATE / CONTACT_TEMPLATE / ORGANIZATION_TEMPLATE imports - platform/test_user.py: hoist `from pydantic import SecretStr` to top of file - platform/test_user_lock.py: remove redundant ApiKeyOperations import inside test - search/test_search.py: hoist `import time` to top of file - catalog/test_assets.py: extract _GITHUB_SAMPLE_URL module constant (2 sites) Results: 259 passed, 5 skipped, 2 destructive deselected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
REST API Test Results265 tests 260 ✅ 23s ⏱️ Results for commit 4de34db. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.