refactor(handlers): handle all http methods
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user