Skip to content

Add client and exception test coverage (step 8)#5

Merged
whitewalls86 merged 3 commits into
masterfrom
step-8-client-tests
Jun 13, 2026
Merged

Add client and exception test coverage (step 8)#5
whitewalls86 merged 3 commits into
masterfrom
step-8-client-tests

Conversation

@whitewalls86

Copy link
Copy Markdown
Owner

Summary

  • Adds 59 new tests across three files: tests/test_client_listings.py, tests/test_client_dealers.py, and tests/test_exceptions.py
  • No SDK implementation changes — purely test coverage

test_client_listings.py (18 tests) - filter serialization specifics: pipe separator for assembly_location, plus separator for exclude_assembly_location, bbox format, geo radius+postal_code, range filters (min/max price, mileage), multi-value comma joining (makes, years), sort and fields projection, sold inventory mode, include param absence when not passed, and FacetsFilter inheriting listing filter params

test_client_dealers.py (13 tests) - all DealerFilter params (dealer_id, country, type, q, make, state, limit/offset) and dealer_inventory routing + ListingsFilter pass-through

test_exceptions.py (28 tests) - full exception class hierarchy (issubclass assertions), VisorAPIError attribute storage and __str__ format, RateLimitError.retry_after with/without header, VisorTransportError from ConnectError and TimeoutException, error body edge cases (non-JSON, missing error key, string error value), and exact-type assertion (type(exc) is VisorAPIError) for unmapped 5xx statuses

Test plan

  • pytest - 170 passed
  • ruff check . - no issues
  • ruff format --check . - no issues
  • mypy src/ - no issues

Generated with Claude Code

whitewalls86 and others added 3 commits June 12, 2026 18:05
59 new tests across three files. No SDK implementation changes.

tests/test_client_listings.py (18 tests): separator quirks (pipe for
assembly_location, plus for exclude_assembly_location), geo filters,
range filters, multi-value comma serialization, sort and fields
projection, sold inventory mode, and include param presence/absence.

tests/test_client_dealers.py (13 tests): all DealerFilter params
(dealer_id, country, type, q, make, state, limit/offset) and
dealer_inventory routing with ListingsFilter pass-through.

tests/test_exceptions.py (28 tests): full exception class hierarchy,
VisorAPIError attribute storage and str format, RateLimitError
retry_after with/without header, VisorTransportError from ConnectError
and TimeoutException, error body edge cases.

Full suite: 170 passed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Multi-value list tests now assert the exact comma-joined param value via
url.params[field] == a,b,c rather than checking each value
individually in the raw URL string. Fixes: test_multiple_makes,
test_year_integers, test_filter_facets_multiple_facet_names,
test_search_dealers_dealer_id, test_search_dealers_make,
test_search_dealers_state.

Unmapped HTTP status tests (500, 503) split out of the mapped-subclass
parametrize and now assert type(exc_info.value) is VisorAPIError to
confirm the base class is raised, not an accidental subclass match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test_multiple_makes_all_present_in_url -> test_multiple_makes_comma_joined_in_param
matches what the test now actually checks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@whitewalls86
whitewalls86 merged commit 649ea35 into master Jun 13, 2026
2 checks passed
@whitewalls86
whitewalls86 deleted the step-8-client-tests branch June 13, 2026 02:39
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