Skip to content

Commit

Permalink
fix(test_api): unittest fix for plain endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Apr 5, 2024
1 parent 8ba01e2 commit 5e9db98
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ def upload_dataset(self, dump_config_to_s3=False):
try:
self.dataset.create_in_hdx(
allow_no_resources=True,
# hxl_update=False,
hxl_update=False,
)
dataset_info["hdx_upload"] = "SUCCESS"
except Exception as ex:
Expand Down
19 changes: 12 additions & 7 deletions tests/test_API.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Standard library imports
import os
import time

# Third party imports
from fastapi.testclient import TestClient

# Reader imports
from API.main import app

client = TestClient(app)
Expand Down Expand Up @@ -722,18 +725,20 @@ def test_snapshot_plain():
response = client.post(
"/v1/snapshot/plain/",
json={
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
[83.98223911755514, 28.21348731781771],
[83.98223911755514, 28.208639873158987],
[83.9881146731152, 28.208639873158987],
[83.9881146731152, 28.21348731781771],
[83.98223911755514, 28.21348731781771],
]
],
}
"type": "Polygon",
},
},
)
assert response.status_code == 200
Expand Down

0 comments on commit 5e9db98

Please sign in to comment.