Files
nanobot/tests/test_gateway_http.py
Hua 9ac73f1e26
Some checks failed
Test Suite / test (3.11) (push) Failing after 1m24s
Test Suite / test (3.12) (push) Failing after 1m46s
Test Suite / test (3.13) (push) Failing after 2m1s
refactor(delivery): use workspace out as artifact root
2026-03-20 09:10:33 +08:00

24 lines
752 B
Python

import pytest
from aiohttp.test_utils import make_mocked_request
from nanobot.gateway.http import create_http_app
@pytest.mark.asyncio
async def test_gateway_health_route_exists() -> None:
app = create_http_app()
request = make_mocked_request("GET", "/healthz", app=app)
match = await app.router.resolve(request)
assert match.route.resource.canonical == "/healthz"
@pytest.mark.asyncio
async def test_gateway_public_route_is_not_registered() -> None:
app = create_http_app()
request = make_mocked_request("GET", "/public/hello.txt", app=app)
match = await app.router.resolve(request)
assert match.http_exception.status == 404
assert [resource.canonical for resource in app.router.resources()] == ["/healthz"]