test_queryparams.py
This file
Path
tests/client/test_queryparams.py
49 lines · 1.6 KiB · Python
Last changed by
Replace httpx.URL for str in tests (#1237)Eduardo Enriquezbefore adoptionaad8209
History of this fileTake it
The walk stopped after 200 commits: lines older than b234203 point at it.
Httpcore interface (#804)Tom Christiebefore adoption3046e92
line 1why, one step back1import typingDetect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
line 2why, one step back2Httpcore interface (#804)Tom Christiebefore adoption3046e92
line 3why, one step back3import httpcoreDetect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
line 4why, one step back4Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 5why, one step back5import httpxHttpcore interface (#804)Tom Christiebefore adoption3046e92
line 6why, one step back6from httpx._content_streams import ContentStream, JSONStreamDetect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
lines 7–8why, one step back78Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
lines 9–10why, one step back9class MockTransport(httpcore.SyncHTTPTransport):10 def request(Detect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
line 11why, one step back11 self,Httpcore interface (#804)Tom Christiebefore adoption3046e92
line 12why, one step back12 method: bytes,Type check tests (#1054)Florimond Mancabefore adoption0296c2b
lines 13–14why, one step back13 url: typing.Tuple[bytes, bytes, typing.Optional[int], bytes],14 headers: typing.List[typing.Tuple[bytes, bytes]] = None,Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 15why, one step back15 stream: httpcore.SyncByteStream = None,Update to httpcore 0.10 (#1126)Tom Christiebefore adoption876e722
line 16why, one step back16 timeout: typing.Mapping[str, typing.Optional[float]] = None,Httpcore interface (#804)Tom Christiebefore adoption3046e92
lines 17–20why, one step back17 ) -> typing.Tuple[18 bytes, int, bytes, typing.List[typing.Tuple[bytes, bytes]], ContentStream19 ]:20 body = JSONStream({"ok": "ok"})Type check tests (#1054)Florimond Mancabefore adoption0296c2b
line 21why, one step back21 return b"HTTP/1.1", 200, b"OK", [], bodyDetect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
lines 22–24why, one step back222324def test_client_queryparams():Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
lines 25–26why, one step back25 client = httpx.Client(params={"a": "b"})26 assert isinstance(client.params, httpx.QueryParams)Detect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
lines 27–30why, one step back27 assert client.params["a"] == "b"282930def test_client_queryparams_string():Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
lines 31–32why, one step back31 client = httpx.Client(params="a=b")32 assert isinstance(client.params, httpx.QueryParams)Detect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
lines 33–34why, one step back33 assert client.params["a"] == "b"34Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 35why, one step back35 client = httpx.Client()Type check tests (#1054)Florimond Mancabefore adoption0296c2b
line 36why, one step back36 client.params = "a=b" # type: ignoreBetter test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 37why, one step back37 assert isinstance(client.params, httpx.QueryParams)Detect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
lines 38–40why, one step back38 assert client.params["a"] == "b"3940Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 41why, one step back41def test_client_queryparams_echo():Detect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
lines 42–44why, one step back42 url = "http://example.org/echo_queryparams"43 client_queryparams = "first=str"44 request_queryparams = {"second": "dict"}Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
lines 45–46why, one step back45 client = httpx.Client(transport=MockTransport(), params=client_queryparams)46 response = client.get(url, params=request_queryparams)Detect credentials in proxy URLs and create Proxy-authorization header (#780)Yeray Diaz Diazbefore adoptionb234203
lines 47–48why, one step back4748 assert response.status_code == 200Replace httpx.URL for str in tests (#1237)Eduardo Enriquezbefore adoptionaad8209
line 49why, one step back49 assert response.url == "http://example.org/echo_queryparams?first=str&second=dict"