Skip to content
Myr

Add test for request params behavior changes (#3364) (#3440)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Elaina · committed by GitHub · parent 0cb7e5a · Browse files · 2 files+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Tom Christie <tom@tomchristie.com>

Diff stats

2 files+14 added−0 removed

  • tests:+13 added−0 removed
  • other:+1 added−0 removed

2 files+14 added−0 removed

modified:tests/models/test_requests.py+13 added
224 unmodified lines
225 request = httpx.Request("POST", "http://example.org", content=content())226 request.read()227 pickle_request = pickle.loads(pickle.dumps(request))228 assert pickle_request.content == b"test 123"229230231def test_request_params():232 request = httpx.Request("GET", "http://example.com", params={})233 assert str(request.url) == "http://example.com"234235 request = httpx.Request(236 "GET", "http://example.com?c=3", params={"a": "1", "b": "2"}237 )238 assert str(request.url) == "http://example.com?a=1&b=2"239240 request = httpx.Request("GET", "http://example.com?a=1", params={})241 assert str(request.url) == "http://example.com"
modified:CHANGELOG.md+1 added
26 unmodified lines
27* Review URL percent escape sets, based on WHATWG spec. (#3371, #3373)28* Ensure `certifi` and `httpcore` are only imported if required. (#3377)29* Treat `socks5h` as a valid proxy scheme. (#3178)30* Cleanup `Request()` method signature in line with `client.request()` and `httpx.request()`. (#3378)31* Bugfix: When passing `params={}`, always strictly update rather than merge with an existing querystring. (#3364)3233## 0.27.2 (27th August, 2024)3435### Fixed
1091 unmodified lines