Skip to content

Commit 67f5f03

Browse files
authored
Merge pull request #174 from stac-utils/event-loop
Fix event loop
2 parents 0e02741 + 4e3835c commit 67f5f03

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

stac_fastapi/elasticsearch/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class Config:
6565
@pytest.fixture(scope="session")
6666
def event_loop():
6767
loop = asyncio.new_event_loop()
68+
asyncio.set_event_loop(loop)
6869
yield loop
6970
loop.close()
7071

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pytest
2+
3+
4+
@pytest.mark.asyncio
5+
async def test_ping_no_param(app_client):
6+
"""
7+
Test ping endpoint with a mocked client.
8+
Args:
9+
app_client (TestClient): mocked client fixture
10+
"""
11+
res = await app_client.get("/_mgmt/ping")
12+
assert res.status_code == 200
13+
assert res.json() == {"message": "PONG"}

0 commit comments

Comments
 (0)