MCPcopy Create free account
hub / github.com/Azure-Samples/rag-postgres-openai-python / test_index

Function test_index

tests/test_frontend_routes.py:7–18  ·  view source on GitHub ↗

test the index route

(test_client)

Source from the content-addressed store, hash-verified

5
6@pytest.mark.asyncio
7async def test_index(test_client):
8 """test the index route"""
9 response = test_client.get("/")
10
11 html_index_file_path = "src/backend/static/index.html"
12 with open(html_index_file_path, "rb") as f:
13 html_index_file = f.read()
14
15 assert response.status_code == 200
16 assert response.headers["Content-Type"] == "text/html; charset=utf-8"
17 assert response.headers["Content-Length"] == str(len(html_index_file))
18 assert html_index_file == response.content
19
20
21@pytest.mark.asyncio

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected