From 9acce7031748d7af368accb5b32a2586281b158b Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Fri, 18 Apr 2025 03:12:02 +0200 Subject: [PATCH] add unit tests for all favicons --- app/tests/test_web_route.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/app/tests/test_web_route.py b/app/tests/test_web_route.py index 6e72d4d..5100914 100644 --- a/app/tests/test_web_route.py +++ b/app/tests/test_web_route.py @@ -21,6 +21,15 @@ async def test_page(): assert response.status_code == 200 assert response.mimetype == 'text/html' + +@pytest.mark.asyncio +async def test_favicon96(): + """Test the favicon-96x96.png route.""" + client = app.test_client() + response = await client.get('/favicon-96x96.png') + assert response.status_code == 200 + assert response.mimetype == 'image/png' + @pytest.mark.asyncio async def test_favicon(): """Test the favicon.ico route.""" @@ -28,3 +37,27 @@ async def test_favicon(): response = await client.get('/favicon.ico') assert response.status_code == 200 assert response.mimetype == 'image/x-icon' + +@pytest.mark.asyncio +async def test_favicon_svg(): + """Test the favicon.svg route.""" + client = app.test_client() + response = await client.get('/favicon.svg') + assert response.status_code == 200 + assert response.mimetype == 'image/svg+xml' + +@pytest.mark.asyncio +async def test_apple_touch_icon(): + """Test the apple-touch-icon.png route.""" + client = app.test_client() + response = await client.get('/apple-touch-icon.png') + assert response.status_code == 200 + assert response.mimetype == 'image/png' + +@pytest.mark.asyncio +async def test_manifest(): + """Test the site.webmanifest route.""" + client = app.test_client() + response = await client.get('/site.webmanifest') + assert response.status_code == 200 + assert response.mimetype == 'application/manifest+json'