Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fix playground from nested api routers #583

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/unit_tests/test_api_playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ async def test_serve_playground_with_api_router() -> None:
async with AsyncClient(app=app, base_url="http://localhost:9999") as client:
response = await client.get("/langserve_runnables/chat/playground/index.html")
assert response.status_code == 200
assert (
'src="/langserve_runnables/chat/playground/assets/' in response.content.decode()
), "html should contain reference to valid playground assets path"


async def test_serve_playground_with_api_router_in_api_router() -> None:
Expand All @@ -67,6 +70,9 @@ async def test_serve_playground_with_api_router_in_api_router() -> None:
async with AsyncClient(app=app, base_url="http://localhost:9999") as client:
response = await client.get("/parent/bar/foo/playground/index.html")
assert response.status_code == 200
assert (
'src="/parent/bar/foo/playground/assets/' in response.content.decode()
), "html should contain reference to valid playground assets path"


async def test_root_path_on_playground() -> None:
Expand Down
Loading