test_status_codes.py
This file
Path
tests/test_status_codes.py
39 lines · 925 bytes · Python
Last changed by
Single consistent name for status codes (#1088)Tom Christiebefore adoption35f09d1
History of this fileTake it
The walk stopped after 200 commits: lines older than 2c4a1dd point at it.
Single consistent name for status codes (#1088)Tom Christiebefore adoption35f09d1
lines 1–2why, one step back1import pytest2Drop OpenConnection (#700)Tom Christiebefore adoption2c4a1dd
lines 3–10why, one step back3import httpx456def test_status_code_as_int():7 assert httpx.codes.NOT_FOUND == 4048 assert str(httpx.codes.NOT_FOUND) == "404"910Single consistent name for status codes (#1088)Tom Christiebefore adoption35f09d1
lines 11–18why, one step back11def test_status_code_value_lookup():12 assert httpx.codes(404) == 404131415def test_status_code_phrase_lookup():16 assert httpx.codes["NOT_FOUND"] == 4041718Drop OpenConnection (#700)Tom Christiebefore adoption2c4a1dd
line 19why, one step back19def test_lowercase_status_code():Type check tests (#1054)Florimond Mancabefore adoption0296c2b
line 20why, one step back20 assert httpx.codes.not_found == 404 # type: ignoreDrop OpenConnection (#700)Tom Christiebefore adoption2c4a1dd
lines 21–28why, one step back212223def test_reason_phrase_for_status_code():24 assert httpx.codes.get_reason_phrase(404) == "Not Found"252627def test_reason_phrase_for_unknown_status_code():28 assert httpx.codes.get_reason_phrase(499) == ""Single consistent name for status codes (#1088)Tom Christiebefore adoption35f09d1
lines 29–39why, one step back293031def test_deprecated_status_code_class():32 with pytest.warns(DeprecationWarning):33 assert httpx.StatusCode.NOT_FOUND == 4043435 with pytest.warns(DeprecationWarning):36 assert httpx.StatusCode(404) == 4043738 with pytest.warns(DeprecationWarning):39 assert httpx.StatusCode["NOT_FOUND"] == 404