Skip to content

Commit

Permalink
misc attempts at getting this thing running
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Apr 11, 2024
1 parent 7e52cc0 commit 10d69d9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/integrate_openapi/request_and_validate_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Test client.utils.request_and_validate module."""

import asyncio
import socket
from typing import AsyncIterator, Callable

Expand Down Expand Up @@ -42,10 +41,10 @@ def post(self) -> None:
raise tornado.web.HTTPError(400, self.get_argument("raise"))
self.write(self.get_argument("echo"))

args = RestHandlerSetup({"debug": True})
rs = RestServer(debug=True)
rs.add_route(TestHandler.ROUTE, TestHandler, RestHandlerSetup({"debug": True}))
rs.add_route(TestHandler.ROUTE, TestHandler, args)
rs.startup(address="localhost", port=port)
await asyncio.sleep(10)

def client() -> RestClient:
return RestClient(f"http://localhost:{port}", retries=0)
Expand Down Expand Up @@ -132,7 +131,7 @@ def client() -> RestClient:
)


def test_000__valid(server: Callable[[], RestClient]) -> None:
async def test_000__valid(server: Callable[[], RestClient]) -> None:
"""Test valid request data."""
rc = server()

Expand All @@ -154,7 +153,7 @@ def test_000__valid(server: Callable[[], RestClient]) -> None:
assert e.value.response.status_code == 400


def test_010__invalid(server: Callable[[], RestClient]) -> None:
async def test_010__invalid(server: Callable[[], RestClient]) -> None:
"""Test invalid request data."""
rc = server()

Expand Down

0 comments on commit 10d69d9

Please sign in to comment.