Skip to content

Commit

Permalink
chore: misc touchups
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 committed Sep 22, 2024
1 parent f20287f commit f0d4f12
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion docs/_newsfragments/2330.newandimproved.rst
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
refactor: Replaced :class:`~falcon.HTTPPayloadTooLarge` with :class:`~falcon.HTTPContentTooLarge` to align with the updated class name.
The class :class:`~falcon.HTTPPayloadTooLarge` was renamed to
:class:`~falcon.HTTPContentTooLarge`, together with the accompanying HTTP
:ref:`status code <status>` updates, in order to reflect the newest HTTP
semantics as per RFC 9110, Section 15.5.14.
(The old class name remains available as a deprecated compatibility alias.)
2 changes: 1 addition & 1 deletion docs/api/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ HTTPStatus
HTTP_GONE = HTTP_410
HTTP_LENGTH_REQUIRED = HTTP_411
HTTP_PRECONDITION_FAILED = HTTP_412
HTTP_REQUEST_ENTITY_TOO_LARGE = HTTP_413
HTTP_CONTENT_TOO_LARGE = HTTP_413
HTTP_REQUEST_URI_TOO_LONG = HTTP_414
HTTP_UNSUPPORTED_MEDIA_TYPE = HTTP_415
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = HTTP_416
Expand Down
2 changes: 1 addition & 1 deletion docs/changes/2.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Fixed
- The :meth:`~falcon.testing.TestClient.simulate_request` method now forces
header values to `str` on Python 2 as required by PEP-3333.
- The ``HTTPRequestEntityTooLarge`` class was renamed to
:class:`~falcon.HTTPContentTooLarge` and the reason phrase was updated
:class:`~falcon.HTTPPayloadTooLarge` and the reason phrase was updated
per RFC 7231.
- The :class:`falcon.CaseInsensitiveDict` class now inherits from
:class:`collections.abc.MutableMapping` under Python 3, instead of
Expand Down
1 change: 0 additions & 1 deletion falcon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
'HTTP_PROCESSING',
'HTTP_PROXY_AUTHENTICATION_REQUIRED',
'HTTP_REQUESTED_RANGE_NOT_SATISFIABLE',
'HTTP_REQUEST_ENTITY_TOO_LARGE',
'HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE',
'HTTP_REQUEST_TIMEOUT',
'HTTP_REQUEST_URI_TOO_LONG',
Expand Down
1 change: 1 addition & 0 deletions falcon/status_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
HTTP_PRECONDITION_FAILED: Final[str] = HTTP_412
HTTP_413: Final[str] = '413 Content Too Large'
HTTP_CONTENT_TOO_LARGE: Final[str] = HTTP_413
HTTP_PAYLOAD_TOO_LARGE: Final[str] = HTTP_413
HTTP_REQUEST_ENTITY_TOO_LARGE: Final[str] = HTTP_413
HTTP_414: Final[str] = '414 URI Too Long'
HTTP_REQUEST_URI_TOO_LONG: Final[str] = HTTP_414
Expand Down
2 changes: 1 addition & 1 deletion tests/test_status_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_statuses_are_in_compliance_with_http_from_python313(self, status):
if status_code >= 700:
pytest.skip('Codes above 700 are not defined in http package')
http_status = http.HTTPStatus(status_code)
if status_code in [413, 418, 422]:
if status_code in [418, 422]:
assert http_status.phrase != message
else:
assert http_status.phrase == message
Expand Down

0 comments on commit f0d4f12

Please sign in to comment.