Skip to content

Commit 7d800db

Browse files
committed
app sort extension
1 parent 1a5fe2f commit 7d800db

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

stac_fastapi/elasticsearch/tests/api/test_api.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def test_app_search_response(load_test_data, app_client, es_transactions):
9595
)
9696

9797

98-
# @pytest.mark.skip(reason="this all passes manually?? assert 0 == 1")
9998
def test_app_context_extension(load_test_data, app_client, es_transactions, es_core):
10099
item = load_test_data("test_item.json")
101100
collection = load_test_data("test_collection.json")
@@ -162,11 +161,11 @@ def test_app_query_extension_gt(load_test_data, app_client, es_transactions):
162161
)
163162

164163

165-
@pytest.mark.skip(reason="assert 0 == 1")
164+
# @pytest.mark.skip(reason="assert 0 == 1")
166165
def test_app_query_extension_gte(load_test_data, app_client, es_transactions):
167166
test_item = load_test_data("test_item.json")
168167
es_transactions.create_item(test_item, request=MockStarletteRequest)
169-
168+
time.sleep(1)
170169
params = {"query": {"proj:epsg": {"gte": test_item["properties"]["proj:epsg"]}}}
171170
resp = app_client.post("/search", json=params)
172171
assert resp.status_code == 200
@@ -215,14 +214,16 @@ def test_app_query_extension_limit_10000(load_test_data, app_client, es_transact
215214
)
216215

217216

218-
@pytest.mark.skip(reason="sort not fully implemented")
217+
@pytest.mark.skip(reason="No mapping found for [properties__datetime.keyword] in order to sort on")
219218
def test_app_sort_extension(load_test_data, app_client, es_transactions):
220219
first_item = load_test_data("test_item.json")
221220
item_date = datetime.strptime(
222221
first_item["properties"]["datetime"], "%Y-%m-%dT%H:%M:%SZ"
223222
)
224223
es_transactions.create_item(first_item, request=MockStarletteRequest)
225224

225+
time.sleep(1)
226+
226227
second_item = load_test_data("test_item.json")
227228
second_item["id"] = "another-item"
228229
another_item_date = item_date - timedelta(days=1)
@@ -231,6 +232,8 @@ def test_app_sort_extension(load_test_data, app_client, es_transactions):
231232
)
232233
es_transactions.create_item(second_item, request=MockStarletteRequest)
233234

235+
time.sleep(1)
236+
234237
params = {
235238
"collections": [first_item["collection"]],
236239
"sortby": [{"field": "datetime", "direction": "desc"}],

0 commit comments

Comments
 (0)