1+ import time
12from datetime import datetime , timedelta
23
34import pytest
@@ -69,14 +70,13 @@ def test_app_transaction_extension(app_client, load_test_data, es_transactions):
6970 item = load_test_data ("test_item.json" )
7071 resp = app_client .post (f"/collections/{ item ['collection' ]} /items" , json = item )
7172 assert resp .status_code == 200
72-
73+ time . sleep ( 1 )
7374 es_transactions .delete_item (
7475 item ["id" ], item ["collection" ], request = MockStarletteRequest
7576 )
7677
7778
7879def test_app_search_response (load_test_data , app_client , es_transactions ):
79-
8080 item = load_test_data ("test_item.json" )
8181 es_transactions .create_item (item , request = MockStarletteRequest )
8282
@@ -94,7 +94,6 @@ def test_app_search_response(load_test_data, app_client, es_transactions):
9494 )
9595
9696
97- @pytest .mark .skip (reason = "this all passes manually?? assert 0 == 1" )
9897def test_app_context_extension (load_test_data , app_client , es_transactions , es_core ):
9998 item = load_test_data ("test_item.json" )
10099 collection = load_test_data ("test_collection.json" )
@@ -104,6 +103,8 @@ def test_app_context_extension(load_test_data, app_client, es_transactions, es_c
104103 es_transactions .create_collection (collection , request = MockStarletteRequest )
105104 es_transactions .create_item (item , request = MockStarletteRequest )
106105
106+ time .sleep (1 )
107+
107108 resp = app_client .get (f"/collections/{ collection ['id' ]} /items/{ item ['id' ]} " )
108109 assert resp .status_code == 200
109110 resp_json = resp .json ()
@@ -115,7 +116,7 @@ def test_app_context_extension(load_test_data, app_client, es_transactions, es_c
115116 resp_json = resp .json ()
116117 assert resp_json ["id" ] == collection ["id" ]
117118
118- resp = app_client .post ("/search" , json = {"collections" : ["test-collection" ]})
119+ resp = app_client .post ("/search" , json = {"collections" : ["test-collection-2 " ]})
119120 assert resp .status_code == 200
120121 resp_json = resp .json ()
121122 assert len (resp_json ["features" ]) == 1
@@ -159,11 +160,10 @@ def test_app_query_extension_gt(load_test_data, app_client, es_transactions):
159160 )
160161
161162
162- @pytest .mark .skip (reason = "assert 0 == 1" )
163163def test_app_query_extension_gte (load_test_data , app_client , es_transactions ):
164164 test_item = load_test_data ("test_item.json" )
165165 es_transactions .create_item (test_item , request = MockStarletteRequest )
166-
166+ time . sleep ( 1 )
167167 params = {"query" : {"proj:epsg" : {"gte" : test_item ["properties" ]["proj:epsg" ]}}}
168168 resp = app_client .post ("/search" , json = params )
169169 assert resp .status_code == 200
@@ -212,14 +212,18 @@ def test_app_query_extension_limit_10000(load_test_data, app_client, es_transact
212212 )
213213
214214
215- @pytest .mark .skip (reason = "sort not fully implemented" )
215+ @pytest .mark .skip (
216+ reason = "No mapping found for [properties__datetime.keyword] in order to sort on"
217+ )
216218def test_app_sort_extension (load_test_data , app_client , es_transactions ):
217219 first_item = load_test_data ("test_item.json" )
218220 item_date = datetime .strptime (
219221 first_item ["properties" ]["datetime" ], "%Y-%m-%dT%H:%M:%SZ"
220222 )
221223 es_transactions .create_item (first_item , request = MockStarletteRequest )
222224
225+ time .sleep (1 )
226+
223227 second_item = load_test_data ("test_item.json" )
224228 second_item ["id" ] = "another-item"
225229 another_item_date = item_date - timedelta (days = 1 )
@@ -228,6 +232,8 @@ def test_app_sort_extension(load_test_data, app_client, es_transactions):
228232 )
229233 es_transactions .create_item (second_item , request = MockStarletteRequest )
230234
235+ time .sleep (1 )
236+
231237 params = {
232238 "collections" : [first_item ["collection" ]],
233239 "sortby" : [{"field" : "datetime" , "direction" : "desc" }],
@@ -263,11 +269,11 @@ def test_search_invalid_date(load_test_data, app_client, es_transactions):
263269 )
264270
265271
266- @pytest .mark .skip (reason = "assert 0 == 1" )
267272def test_search_point_intersects (load_test_data , app_client , es_transactions ):
268273 item = load_test_data ("test_item.json" )
269274 es_transactions .create_item (item , request = MockStarletteRequest )
270275
276+ time .sleep (2 )
271277 point = [150.04 , - 33.14 ]
272278 intersects = {"type" : "Point" , "coordinates" : point }
273279
@@ -276,19 +282,20 @@ def test_search_point_intersects(load_test_data, app_client, es_transactions):
276282 "collections" : [item ["collection" ]],
277283 }
278284 resp = app_client .post ("/search" , json = params )
279- es_transactions .delete_item (
280- item ["id" ], item ["collection" ], request = MockStarletteRequest
281- )
282285
283286 assert resp .status_code == 200
284287 resp_json = resp .json ()
285288 assert len (resp_json ["features" ]) == 1
286289
290+ es_transactions .delete_item (
291+ item ["id" ], item ["collection" ], request = MockStarletteRequest
292+ )
293+
287294
288- @pytest .mark .skip (reason = "unknown" )
289295def test_datetime_non_interval (load_test_data , app_client , es_transactions ):
290296 item = load_test_data ("test_item.json" )
291297 es_transactions .create_item (item , request = MockStarletteRequest )
298+ time .sleep (2 )
292299 alternate_formats = [
293300 "2020-02-12T12:30:22+00:00" ,
294301 "2020-02-12T12:30:22.00Z" ,
@@ -312,10 +319,10 @@ def test_datetime_non_interval(load_test_data, app_client, es_transactions):
312319 )
313320
314321
315- @pytest .mark .skip (reason = "unknown" )
316322def test_bbox_3d (load_test_data , app_client , es_transactions ):
317323 item = load_test_data ("test_item.json" )
318324 es_transactions .create_item (item , request = MockStarletteRequest )
325+ time .sleep (1 )
319326
320327 australia_bbox = [106.343365 , - 47.199523 , 0.1 , 168.218365 , - 19.437288 , 0.1 ]
321328 params = {
@@ -331,10 +338,10 @@ def test_bbox_3d(load_test_data, app_client, es_transactions):
331338 )
332339
333340
334- @pytest .mark .skip (reason = "unknown" )
335341def test_search_line_string_intersects (load_test_data , app_client , es_transactions ):
336342 item = load_test_data ("test_item.json" )
337343 es_transactions .create_item (item , request = MockStarletteRequest )
344+ time .sleep (2 )
338345
339346 line = [[150.04 , - 33.14 ], [150.22 , - 33.89 ]]
340347 intersects = {"type" : "LineString" , "coordinates" : line }
0 commit comments