Add client and exception test coverage (step 8)#5
Merged
Conversation
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>
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.
Summary
tests/test_client_listings.py,tests/test_client_dealers.py, andtests/test_exceptions.pytest_client_listings.py (18 tests) - filter serialization specifics: pipe separator for
assembly_location, plus separator forexclude_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,includeparam absence when not passed, andFacetsFilterinheriting listing filter paramstest_client_dealers.py (13 tests) - all
DealerFilterparams (dealer_id,country,type,q,make,state,limit/offset) anddealer_inventoryrouting +ListingsFilterpass-throughtest_exceptions.py (28 tests) - full exception class hierarchy (
issubclassassertions),VisorAPIErrorattribute storage and__str__format,RateLimitError.retry_afterwith/without header,VisorTransportErrorfromConnectErrorandTimeoutException, error body edge cases (non-JSON, missingerrorkey, stringerrorvalue), and exact-type assertion (type(exc) is VisorAPIError) for unmapped 5xx statusesTest plan
pytest- 170 passedruff check .- no issuesruff format --check .- no issuesmypy src/- no issuesGenerated with Claude Code