Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query param types incorrect compared directly rather than string-to-string #109

Open
sarayourfriend opened this issue Dec 31, 2023 · 0 comments
Labels

Comments

@sarayourfriend
Copy link
Collaborator

Query params are always strings and should be compared as such, even if passed as something else to the mock constructor.

For example, the following should work:

pook.get("https://example.com").params({"x": 1})
res = urlopen("https://example.com?x=1")

However, this fails with the following matcher error:

E           => Cannot match any mock for the following request:
E           ==================================================
E           Method: GET
E           URL: https://example.com:443/?x=1
E           Query: {'x': ['1']}
E           Headers: HTTPHeaderDict({'Host': 'example.com', 'User-Agent': 'Python-urllib/3.12', 'Connection': 'close'})
E           ==================================================
E           
E           => Detailed matching errors:
E           QueryMatcher: 1 != '1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant