mirror of
https://github.com/correl/tornado-openapi3.git
synced 2024-12-27 11:09:53 +00:00
Remove 418 responses from tests
Older versions of Tornado raise a ValueError when supplied with HTTP status code 418. I guess it's anti-teapot.
This commit is contained in:
parent
3b3085652d
commit
10e5784543
1 changed files with 6 additions and 6 deletions
|
@ -82,27 +82,27 @@ class IncorrectResponseTests(BaseTestCase):
|
|||
spec = spec(responses={"200": {"description": "Success"}})
|
||||
|
||||
async def get(self, handler: tornado.web.RequestHandler) -> None:
|
||||
handler.set_status(418)
|
||||
handler.set_status(400)
|
||||
|
||||
def test_unexpected_response_code(self) -> None:
|
||||
with self.assertRaises(InvalidResponse) as context:
|
||||
self.fetch("/resource")
|
||||
self.assertEqual("418", context.exception.http_status)
|
||||
self.assertEqual("400", context.exception.http_status)
|
||||
|
||||
|
||||
class RaiseErrorTests(BaseTestCase):
|
||||
spec = spec(
|
||||
responses={
|
||||
"418": {
|
||||
"description": "I'm a teapot",
|
||||
"500": {
|
||||
"description": "An error has occurred.",
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
async def get(self, handler: tornado.web.RequestHandler) -> None:
|
||||
handler.set_status(418)
|
||||
handler.set_status(500)
|
||||
|
||||
def test_fetch_throws_error_on_expected_failure(self) -> None:
|
||||
with self.assertRaises(tornado.httpclient.HTTPError) as context:
|
||||
self.fetch("/resource", raise_error=True)
|
||||
self.assertEqual(418, context.exception.code)
|
||||
self.assertEqual(500, context.exception.code)
|
||||
|
|
Loading…
Reference in a new issue