Skip to content

Vcst restapi phase2 hygiene#139

Merged
Lenajava1 merged 2 commits into
devfrom
vcst-restapi-phase2-hygiene
Apr 17, 2026
Merged

Vcst restapi phase2 hygiene#139
Lenajava1 merged 2 commits into
devfrom
vcst-restapi-phase2-hygiene

Conversation

@Lenajava1
Copy link
Copy Markdown
Collaborator

No description provided.

Lenajava1 and others added 2 commits April 17, 2026 12:51
…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>
@github-actions
Copy link
Copy Markdown

REST API Test Results

265 tests   260 ✅  23s ⏱️
  3 suites    5 💤
  3 files      0 ❌

Results for commit 4de34db.

@Lenajava1 Lenajava1 merged commit 3bd9425 into dev Apr 17, 2026
3 checks passed
@Lenajava1 Lenajava1 deleted the vcst-restapi-phase2-hygiene branch April 29, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant