-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
505cc16
commit 0514d42
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
28 changes: 28 additions & 0 deletions
28
tests_v2/unit/app/routes/thematic/geoencoder/test_geoencoder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
from httpx import AsyncClient | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_geoencoder_no_version(async_client: AsyncClient) -> None: | ||
params = {"country": "Canada"} | ||
|
||
resp = await async_client.get("/thematic/geoencode", params=params) | ||
|
||
assert resp.status_code == 400 | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_geoencoder_fake_country_no_matches(async_client: AsyncClient) -> None: | ||
|
||
params = {"admin_version": "4.1", "country": "Canadiastan"} | ||
|
||
resp = await async_client.get("/thematic/geoencode", params=params) | ||
|
||
assert resp.status_code == 200 | ||
assert resp.status_code == { | ||
"status": "success", | ||
"data": { | ||
"adminVersion": "4.1", | ||
"matches": [] | ||
} | ||
} |