diff --git a/stac_fastapi/elasticsearch/tests/conftest.py b/stac_fastapi/elasticsearch/tests/conftest.py index f4b49928..fa093af2 100644 --- a/stac_fastapi/elasticsearch/tests/conftest.py +++ b/stac_fastapi/elasticsearch/tests/conftest.py @@ -65,6 +65,7 @@ class Config: @pytest.fixture(scope="session") def event_loop(): loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) yield loop loop.close() diff --git a/stac_fastapi/elasticsearch/tests/resources/test_mgmt.py b/stac_fastapi/elasticsearch/tests/resources/test_mgmt.py new file mode 100644 index 00000000..2b7d9728 --- /dev/null +++ b/stac_fastapi/elasticsearch/tests/resources/test_mgmt.py @@ -0,0 +1,13 @@ +import pytest + + +@pytest.mark.asyncio +async def test_ping_no_param(app_client): + """ + Test ping endpoint with a mocked client. + Args: + app_client (TestClient): mocked client fixture + """ + res = await app_client.get("/_mgmt/ping") + assert res.status_code == 200 + assert res.json() == {"message": "PONG"}