Skip to content

Commit

Permalink
Merge pull request #6592 from atatuzuner61/bug/6584
Browse files Browse the repository at this point in the history
"TOO_EARLY" type definition for status code 425
  • Loading branch information
sigmavirus24 authored Dec 16, 2023
2 parents 1ddf014 + ec84f2c commit 3b5978f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/requests/status_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
422: ("unprocessable_entity", "unprocessable"),
423: ("locked",),
424: ("failed_dependency", "dependency"),
425: ("unordered_collection", "unordered"),
425: ("unordered_collection", "unordered", "too_early"),
426: ("upgrade_required", "upgrade"),
428: ("precondition_required", "precondition"),
429: ("too_many_requests", "too_many"),
Expand Down
15 changes: 15 additions & 0 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2795,3 +2795,18 @@ def test_json_decode_persists_doc_attr(self, httpbin):
with pytest.raises(requests.exceptions.JSONDecodeError) as excinfo:
r.json()
assert excinfo.value.doc == r.text

def test_status_code_425(self):
r1 = requests.codes.get("TOO_EARLY")
r2 = requests.codes.get("too_early")
r3 = requests.codes.get("UNORDERED")
r4 = requests.codes.get("unordered")
r5 = requests.codes.get("UNORDERED_COLLECTION")
r6 = requests.codes.get("unordered_collection")

assert r1 == 425
assert r2 == 425
assert r3 == 425
assert r4 == 425
assert r5 == 425
assert r6 == 425

0 comments on commit 3b5978f

Please sign in to comment.