diff --git a/app/src/server.py b/app/src/server.py index 9cf5f6b..2bf6e1d 100644 --- a/app/src/server.py +++ b/app/src/server.py @@ -33,11 +33,6 @@ class ProxyState: app = Quart(__name__) -@app.route('/') -async def hello(): - return Response(response="Hello, world") - - @app.route('/-/ready') async def ready(): if ProxyState.is_up(): diff --git a/app/src/web/route.py b/app/src/web/route.py new file mode 100644 index 0000000..0625706 --- /dev/null +++ b/app/src/web/route.py @@ -0,0 +1,8 @@ +from quart import Response + +from server import app + + +@app.route('/') +async def hello(): + return Response(response="Hello, world") diff --git a/app/tests/test_server.py b/app/tests/test_server.py index 0db3324..1fdae63 100644 --- a/app/tests/test_server.py +++ b/app/tests/test_server.py @@ -33,16 +33,6 @@ def test_get_log_level(): log_lvl = get_log_level() assert log_lvl == None - -@pytest.mark.asyncio -async def test_home(): - """Test the home route.""" - client = app.test_client() - response = await client.get('/') - assert response.status_code == 200 - result = await response.get_data() - assert result == b"Hello, world" - @pytest.mark.asyncio async def test_ready(): """Test the ready route.""" diff --git a/app/tests/test_web_route.py b/app/tests/test_web_route.py new file mode 100644 index 0000000..50e9576 --- /dev/null +++ b/app/tests/test_web_route.py @@ -0,0 +1,15 @@ +# test_with_pytest.py +import pytest +from web.route import app + +pytest_plugins = ('pytest_asyncio',) + + +@pytest.mark.asyncio +async def test_home(): + """Test the home route.""" + client = app.test_client() + response = await client.get('/') + assert response.status_code == 200 + result = await response.get_data() + assert result == b"Hello, world"