From f3bc22ef68a07559925c93b1dc22a23c88e3be17 Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Sun, 4 May 2025 18:44:01 +0200 Subject: [PATCH] add unit tests --- app/tests/test_web_route.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/tests/test_web_route.py b/app/tests/test_web_route.py index cf5f307..4ed9b36 100644 --- a/app/tests/test_web_route.py +++ b/app/tests/test_web_route.py @@ -68,6 +68,13 @@ async def test_rel_page(client): assert response.mimetype == 'text/html' web.build_relative_urls = False +@pytest.mark.asyncio +async def test_notes(client): + """Test the notes page route.""" + response = await client.get('/notes') + assert response.status_code == 200 + assert response.mimetype == 'text/html' + @pytest.mark.asyncio async def test_logging(client): """Test the logging page route.""" @@ -185,6 +192,15 @@ async def test_mqtt_fetch(client, create_inverter): assert response.status_code == 200 +@pytest.mark.asyncio +async def test_notes_fetch(client, config_conn): + """Test the notes-fetch route.""" + _ = create_inverter + + response = await client.get('/notes-fetch') + assert response.status_code == 200 + + @pytest.mark.asyncio async def test_file_fetch(client, config_conn): """Test the data-fetch route."""