Skip to content
Myr

test_status_codes.py

This file

Path

tests/test_status_codes.py

18 lines · 418 bytes · Python

Last changed by

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

History of this file

Take it

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

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 1why, one step back
1import httpx

Int status codes (#92)Tom Christiebefore adoption56a7943

lines 2–4why, one step back
2
34def test_status_code_as_int():

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

lines 5–6why, one step back
5 assert httpx.codes.NOT_FOUND == 404
6 assert str(httpx.codes.NOT_FOUND) == "404"

Int status codes (#92)Tom Christiebefore adoption56a7943

lines 7–9why, one step back
7
89def test_lowercase_status_code():

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 10why, one step back
10 assert httpx.codes.not_found == 404

Int status codes (#92)Tom Christiebefore adoption56a7943

lines 11–13why, one step back
11
1213def test_reason_phrase_for_status_code():

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 14why, one step back
14 assert httpx.codes.get_reason_phrase(404) == "Not Found"

Int status codes (#92)Tom Christiebefore adoption56a7943

lines 15–17why, one step back
15
1617def test_reason_phrase_for_unknown_status_code():

Renaming -> httpx (#129)Tom Christiebefore adoption2d09d5b

line 18why, one step back
18 assert httpx.codes.get_reason_phrase(499) == ""