Skip to content

Commit

Permalink
test: make asyncapi asgi test in-memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Aug 3, 2024
1 parent b4e171e commit 6223ff2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/asgi/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,17 @@ async def test_asgi_ping_healthy(self):
response = client.get("/health")
assert response.status_code == 204

def test_asyncapi_asgi(self):
@pytest.mark.asyncio()
async def test_asyncapi_asgi(self):
broker = self.get_broker()

app = AsgiFastStream(broker, asyncapi_path="/docs")

with TestClient(app) as client:
response = client.get("/docs")
assert response.status_code == 200
assert response.text
async with self.get_test_broker(broker):
with TestClient(app) as client:
response = client.get("/docs")
assert response.status_code == 200
assert response.text

def test_get_decorator(self):
@get
Expand Down

0 comments on commit 6223ff2

Please sign in to comment.