Skip to content
Myr

test_status_codes.py

This file

Path

tests/test_status_codes.py

27 lines · 711 bytes · Python

Last changed by

Typing: enable strict_equality (#2480)Martijn Pietersbefore adoption884a69a

History of this file

Take it

The walk stopped after 200 commits: lines older than c531263 point at it.

Bump flake8-bugbear from 21.4.3 to 21.9.2 (#1917)dependabot[bot]before adoptionc531263

lines 1–4why, one step back
1import httpx
234def test_status_code_as_int():

Typing: enable strict_equality (#2480)Martijn Pietersbefore adoption884a69a

lines 5–6why, one step back
5 # mypy doesn't (yet) recognize that IntEnum members are ints, so ignore it here
6 assert httpx.codes.NOT_FOUND == 404 # type: ignore[comparison-overlap]

Bump flake8-bugbear from 21.4.3 to 21.9.2 (#1917)dependabot[bot]before adoptionc531263

lines 7–27why, one step back
7 assert str(httpx.codes.NOT_FOUND) == "404"
8910def test_status_code_value_lookup():11 assert httpx.codes(404) == 404121314def test_status_code_phrase_lookup():15 assert httpx.codes["NOT_FOUND"] == 404161718def test_lowercase_status_code():19 assert httpx.codes.not_found == 404 # type: ignore202122def test_reason_phrase_for_status_code():23 assert httpx.codes.get_reason_phrase(404) == "Not Found"242526def test_reason_phrase_for_unknown_status_code():27 assert httpx.codes.get_reason_phrase(499) == ""