fix exception when file does not exist

fixes https://git.clan.lol/clan/clan-core/issues/488
This commit is contained in:
Jörg Thalheim
2023-11-14 16:55:01 +01:00
parent 8b42d0207a
commit f65bd8aa85
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import pytest
from api import TestClient
@pytest.mark.impure
def test_static_files(api: TestClient) -> None:
response = api.get("/")
assert response.headers["content-type"] == "text/html; charset=utf-8"
response = api.get("/does-no-exists.txt")
assert response.status_code == 404