test(geocoding): hard regression tests for enable_address_descriptor (fixes #540)#543
Open
Rahulcse79 wants to merge 1 commit intogooglemaps:masterfrom
Open
Conversation
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
Fixes #540 —
reverse_geocode() got an unexpected keyword argument 'enable_address_descriptor'.The
enable_address_descriptorkeyword argument was added togooglemaps/geocoding.pyin #516 but is not present in the published4.10.0release on PyPI, so end users calling:still hit a
TypeError. This PR locks the public surface down with a hard, regression-proof test suite so the kwarg can never silently disappear from a future release again.What changed
tests/test_geocoding_advanced.py— 17 tests + 9 sub-tests, all passing.The new tests cover:
inspect.signatureguards on bothgeocoding.reverse_geocodeandClient.reverse_geocode(signature-level regression for Release failed - unexpected keyword argument: enable_address_descriptor still not supported #540).TypeErroris raised.enable_address_descriptor=True→ sendsenable_address_descriptor=trueon the wire.False/ falsy values (None,0,"",[],{}) omit the parameter.1,"yes",["x"],{"a":1}) send"true".result_type,location_type,language.latlnginput forms: tuple, list, dict,"lat,lng"string, andplace_idstring.address_descriptor(landmarks + areas) is parsed correctly from the response.geocoding.reverse_geocode(client, ...)) also works.TypeError.Test results
Note for maintainers
A new release (e.g.
4.10.1) cut frommasterwould close #540 for end users on PyPI. These tests guarantee any future refactor ofreverse_geocodekeeps the documented kwarg.