Skip to content

Commit

Permalink
Merge pull request #174 from stac-utils/event-loop
Browse files Browse the repository at this point in the history
Fix event loop
  • Loading branch information
jonhealy1 authored Dec 9, 2023
2 parents 0e02741 + 4e3835c commit 67f5f03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions stac_fastapi/elasticsearch/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
13 changes: 13 additions & 0 deletions stac_fastapi/elasticsearch/tests/resources/test_mgmt.py
Original file line number Diff line number Diff line change
@@ -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"}

0 comments on commit 67f5f03

Please sign in to comment.