test_properties.py
This file
Path
tests/client/test_properties.py
60 lines · 1.9 KiB · Python
Last changed by
Event hooks (#1246)Tom Christiebefore adoption54f7708
History of this fileTake it
The walk stopped after 200 commits: lines older than e107e0f point at it.
Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 1why, one step back1import httpxBase URL improvements (#1130)Tom Christiebefore adoptiona3392c6
lines 2–4why, one step back234def test_client_base_url():Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 5why, one step back5 client = httpx.Client()Base URL improvements (#1130)Tom Christiebefore adoptiona3392c6
line 6why, one step back6 client.base_url = "https://www.example.org/" # type: ignoreBetter test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 7why, one step back7 assert isinstance(client.base_url, httpx.URL)Replace httpx.URL for str in tests (#1237)Eduardo Enriquezbefore adoptionaad8209
line 8why, one step back8 assert client.base_url == "https://www.example.org/"Base URL improvements (#1130)Tom Christiebefore adoptiona3392c6
lines 9–11why, one step back91011def test_client_base_url_without_trailing_slash():Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 12why, one step back12 client = httpx.Client()Base URL improvements (#1130)Tom Christiebefore adoptiona3392c6
line 13why, one step back13 client.base_url = "https://www.example.org/path" # type: ignoreBetter test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 14why, one step back14 assert isinstance(client.base_url, httpx.URL)Replace httpx.URL for str in tests (#1237)Eduardo Enriquezbefore adoptionaad8209
line 15why, one step back15 assert client.base_url == "https://www.example.org/path/"Base URL improvements (#1130)Tom Christiebefore adoptiona3392c6
lines 16–18why, one step back161718def test_client_base_url_with_trailing_slash():Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 19why, one step back19 client = httpx.Client()Base URL improvements (#1130)Tom Christiebefore adoptiona3392c6
line 20why, one step back20 client.base_url = "https://www.example.org/path/" # type: ignoreBetter test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 21why, one step back21 assert isinstance(client.base_url, httpx.URL)Replace httpx.URL for str in tests (#1237)Eduardo Enriquezbefore adoptionaad8209
line 22why, one step back22 assert client.base_url == "https://www.example.org/path/"Tighten public client methods (#997)Tom Christiebefore adoptione107e0f
lines 23–25why, one step back232425def test_client_headers():Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 26why, one step back26 client = httpx.Client()Tighten public client methods (#997)Tom Christiebefore adoptione107e0f
line 27why, one step back27 client.headers = {"a": "b"} # type: ignoreBetter test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 28why, one step back28 assert isinstance(client.headers, httpx.Headers)Tighten public client methods (#997)Tom Christiebefore adoptione107e0f
lines 29–32why, one step back29 assert client.headers["A"] == "b"303132def test_client_cookies():Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 33why, one step back33 client = httpx.Client()Tighten public client methods (#997)Tom Christiebefore adoptione107e0f
line 34why, one step back34 client.cookies = {"a": "b"} # type: ignoreBetter test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 35why, one step back35 assert isinstance(client.cookies, httpx.Cookies)Tighten public client methods (#997)Tom Christiebefore adoptione107e0f
lines 36–38why, one step back36 mycookies = list(client.cookies.jar)37 assert len(mycookies) == 138 assert mycookies[0].name == "a" and mycookies[0].value == "b"#1066 make BaseClient's timeout accessible using getters and setters (#1135)cdelerbefore adoption7123b0f
lines 39–42why, one step back394041def test_client_timeout():42 expected_timeout = 12.0Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 43why, one step back43 client = httpx.Client()#1066 make BaseClient's timeout accessible using getters and setters (#1135)cdelerbefore adoption7123b0f
lines 44–46why, one step back4445 client.timeout = expected_timeout # type: ignore46Better test case consistency. Prefer `import httpx` and `httpx.Client`. (#1222)Tom Christiebefore adoption28c7205
line 47why, one step back47 assert isinstance(client.timeout, httpx.Timeout)#1066 make BaseClient's timeout accessible using getters and setters (#1135)cdelerbefore adoption7123b0f
lines 48–51why, one step back48 assert client.timeout.connect == expected_timeout49 assert client.timeout.read == expected_timeout50 assert client.timeout.write == expected_timeout51 assert client.timeout.pool == expected_timeoutEvent hooks (#1246)Tom Christiebefore adoption54f7708
lines 52–60why, one step back525354def test_client_event_hooks():55 def on_request(request):56 pass # pragma: nocover5758 client = httpx.Client()59 client.event_hooks = {"request": [on_request]}60 assert client.event_hooks == {"request": [on_request], "response": []}