refactor(handlers): handle all http methods

This commit is contained in:
2026-04-20 13:51:19 +02:00
parent 4e50c42100
commit fb70638330
2 changed files with 38 additions and 0 deletions
+20
View File
@@ -243,6 +243,26 @@ class TestRequestHandler(BaseHandlerTestCase):
):
handler.do_PUT()
def test_do_post_is_do_put(self) -> None:
handler = self._get_handler("/path")
with (
self.expects_error(
handler, http.HTTPStatus.BAD_REQUEST, "No X-Token header in request"
),
self.seal_mocks(),
):
handler.do_POST()
def test_do_patch_is_do_put(self) -> None:
handler = self._get_handler("/path")
with (
self.expects_error(
handler, http.HTTPStatus.BAD_REQUEST, "No X-Token header in request"
),
self.seal_mocks(),
):
handler.do_PATCH()
def test_do_put_invalid_token(self) -> None:
handler = self._get_handler("/path", {"X-Token": "secret"})
with (