Skip to content

Commit

Permalink
move TestHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Apr 12, 2024
1 parent 9969088 commit 6e00c80
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/integrate_openapi/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ def port() -> int:
s.close()
return ephemeral_port


class TestHandler(RestHandler):
ROUTE = "/echo/this"

async def post(self) -> None:
self.write({})
# if self.get_argument("raise", None):
# raise tornado.web.HTTPError(400, self.get_argument("raise"))
# self.write(self.get_argument("echo", {}))
@pytest_asyncio.fixture
async def server(port: int) -> AsyncIterator[Callable[[], RestClient]]:
"""Start up REST server and attach handlers."""

class TestHandler(RestHandler):
ROUTE = "/echo/this"

async def post(self) -> None:
self.write({})
# if self.get_argument("raise", None):
# raise tornado.web.HTTPError(400, self.get_argument("raise"))
# self.write(self.get_argument("echo", {}))

rs = RestServer(debug=True)
rs.add_route(TestHandler.ROUTE, TestHandler)
Expand Down

0 comments on commit 6e00c80

Please sign in to comment.