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

match strange URL doesn't work... #193

Open
jedie opened this issue Jan 18, 2022 · 1 comment
Open

match strange URL doesn't work... #193

jedie opened this issue Jan 18, 2022 · 1 comment

Comments

@jedie
Copy link

jedie commented Jan 18, 2022

I must match a strange URL like: http://example.tld/path/key=foo?bar=1
It seems that this is not possible and i must use requests_mock.ANY

@jamielennox
Copy link
Owner

jamielennox commented Apr 19, 2022

Ok, so this is weird because the key=foo is part of the path, and bar is part of the querystring.

Even with that it does appear to work, got any other examples:

import requests
import requests_mock

with requests_mock.mock() as m:
    m.get("http://example.tld/path/key=foo?bar=1", text="1")

    requests.get("http://example.tld/path/key=foo?bar=1&baz=2")
certifi==2021.10.8
charset-normalizer==2.0.12
idna==3.3
requests==2.27.1
-e git+ssh://[email protected]/jamielennox/requests-mock.git@0aeaecd3f43be0fc99a342fa2d6f77d9702997b1#egg=requests_mock
six==1.16.0
urllib3==1.26.9

There was some weirdness around reencoding unexpected variables, but that should have been sorted out in at least the last release.

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

No branches or pull requests

2 participants