test the index route
(test_client)
| 5 | |
| 6 | @pytest.mark.asyncio |
| 7 | async 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 |
nothing calls this directly
no outgoing calls
no test coverage detected