test_status_codes.py
This file
Path
tests/test_status_codes.py
26 lines · 591 bytes · Python
Last changed by
Escalate 0.17 deprecation warnings to becoming fully deprecated. (#1597)Tom Christiebefore adoption6e55ca1
History of this fileTake it
The walk stopped after 200 commits: lines older than 78cf16a point at it.
Drop HSTS Preloading (#1110)Florimond Mancabefore adoption78cf16a
lines 1–26why, one step back1import httpx234def test_status_code_as_int():5 assert httpx.codes.NOT_FOUND == 4046 assert str(httpx.codes.NOT_FOUND) == "404"789def test_status_code_value_lookup():10 assert httpx.codes(404) == 404111213def test_status_code_phrase_lookup():14 assert httpx.codes["NOT_FOUND"] == 404151617def test_lowercase_status_code():18 assert httpx.codes.not_found == 404 # type: ignore192021def test_reason_phrase_for_status_code():22 assert httpx.codes.get_reason_phrase(404) == "Not Found"232425def test_reason_phrase_for_unknown_status_code():26 assert httpx.codes.get_reason_phrase(499) == ""