19
19
"POST /collections" ,
20
20
"POST /collections/{collection_id}/items" ,
21
21
"PUT /collections" ,
22
- "PUT /collections/{collection_id}/items" ,
22
+ "PUT /collections/{collection_id}/items/{item_id} " ,
23
23
]
24
24
25
25
@@ -66,7 +66,9 @@ def test_app_transaction_extension(app_client, load_test_data):
66
66
67
67
def test_app_search_response (load_test_data , app_client , postgres_transactions ):
68
68
item = load_test_data ("test_item.json" )
69
- postgres_transactions .create_item (item , request = MockStarletteRequest )
69
+ postgres_transactions .create_item (
70
+ item ["collection" ], item , request = MockStarletteRequest
71
+ )
70
72
71
73
resp = app_client .get ("/search" , params = {"collections" : ["test-collection" ]})
72
74
assert resp .status_code == 200
@@ -82,7 +84,9 @@ def test_app_search_response_multipolygon(
82
84
load_test_data , app_client , postgres_transactions
83
85
):
84
86
item = load_test_data ("test_item_multipolygon.json" )
85
- postgres_transactions .create_item (item , request = MockStarletteRequest )
87
+ postgres_transactions .create_item (
88
+ item ["collection" ], item , request = MockStarletteRequest
89
+ )
86
90
87
91
resp = app_client .get ("/search" , params = {"collections" : ["test-collection" ]})
88
92
assert resp .status_code == 200
@@ -96,7 +100,9 @@ def test_app_search_response_geometry_null(
96
100
load_test_data , app_client , postgres_transactions
97
101
):
98
102
item = load_test_data ("test_item_geometry_null.json" )
99
- postgres_transactions .create_item (item , request = MockStarletteRequest )
103
+ postgres_transactions .create_item (
104
+ item ["collection" ], item , request = MockStarletteRequest
105
+ )
100
106
101
107
resp = app_client .get ("/search" , params = {"collections" : ["test-collection" ]})
102
108
assert resp .status_code == 200
@@ -109,7 +115,9 @@ def test_app_search_response_geometry_null(
109
115
110
116
def test_app_context_extension (load_test_data , app_client , postgres_transactions ):
111
117
item = load_test_data ("test_item.json" )
112
- postgres_transactions .create_item (item , request = MockStarletteRequest )
118
+ postgres_transactions .create_item (
119
+ item ["collection" ], item , request = MockStarletteRequest
120
+ )
113
121
114
122
resp = app_client .get ("/search" , params = {"collections" : ["test-collection" ]})
115
123
assert resp .status_code == 200
@@ -120,7 +128,9 @@ def test_app_context_extension(load_test_data, app_client, postgres_transactions
120
128
121
129
def test_app_fields_extension (load_test_data , app_client , postgres_transactions ):
122
130
item = load_test_data ("test_item.json" )
123
- postgres_transactions .create_item (item , request = MockStarletteRequest )
131
+ postgres_transactions .create_item (
132
+ item ["collection" ], item , request = MockStarletteRequest
133
+ )
124
134
125
135
resp = app_client .get ("/search" , params = {"collections" : ["test-collection" ]})
126
136
assert resp .status_code == 200
@@ -130,7 +140,9 @@ def test_app_fields_extension(load_test_data, app_client, postgres_transactions)
130
140
131
141
def test_app_query_extension_gt (load_test_data , app_client , postgres_transactions ):
132
142
test_item = load_test_data ("test_item.json" )
133
- postgres_transactions .create_item (test_item , request = MockStarletteRequest )
143
+ postgres_transactions .create_item (
144
+ test_item ["collection" ], test_item , request = MockStarletteRequest
145
+ )
134
146
135
147
params = {"query" : {"proj:epsg" : {"gt" : test_item ["properties" ]["proj:epsg" ]}}}
136
148
resp = app_client .post ("/search" , json = params )
@@ -141,7 +153,9 @@ def test_app_query_extension_gt(load_test_data, app_client, postgres_transaction
141
153
142
154
def test_app_query_extension_gte (load_test_data , app_client , postgres_transactions ):
143
155
test_item = load_test_data ("test_item.json" )
144
- postgres_transactions .create_item (test_item , request = MockStarletteRequest )
156
+ postgres_transactions .create_item (
157
+ test_item ["collection" ], test_item , request = MockStarletteRequest
158
+ )
145
159
146
160
params = {"query" : {"proj:epsg" : {"gte" : test_item ["properties" ]["proj:epsg" ]}}}
147
161
resp = app_client .post ("/search" , json = params )
@@ -160,7 +174,9 @@ def test_app_query_extension_limit_lt0(
160
174
load_test_data , app_client , postgres_transactions
161
175
):
162
176
item = load_test_data ("test_item.json" )
163
- postgres_transactions .create_item (item , request = MockStarletteRequest )
177
+ postgres_transactions .create_item (
178
+ item ["collection" ], item , request = MockStarletteRequest
179
+ )
164
180
165
181
params = {"limit" : - 1 }
166
182
resp = app_client .post ("/search" , json = params )
@@ -171,7 +187,9 @@ def test_app_query_extension_limit_gt10000(
171
187
load_test_data , app_client , postgres_transactions
172
188
):
173
189
item = load_test_data ("test_item.json" )
174
- postgres_transactions .create_item (item , request = MockStarletteRequest )
190
+ postgres_transactions .create_item (
191
+ item ["collection" ], item , request = MockStarletteRequest
192
+ )
175
193
176
194
params = {"limit" : 10001 }
177
195
resp = app_client .post ("/search" , json = params )
@@ -182,7 +200,9 @@ def test_app_query_extension_limit_10000(
182
200
load_test_data , app_client , postgres_transactions
183
201
):
184
202
item = load_test_data ("test_item.json" )
185
- postgres_transactions .create_item (item , request = MockStarletteRequest )
203
+ postgres_transactions .create_item (
204
+ item ["collection" ], item , request = MockStarletteRequest
205
+ )
186
206
187
207
params = {"limit" : 10000 }
188
208
resp = app_client .post ("/search" , json = params )
@@ -194,15 +214,19 @@ def test_app_sort_extension(load_test_data, app_client, postgres_transactions):
194
214
item_date = datetime .strptime (
195
215
first_item ["properties" ]["datetime" ], "%Y-%m-%dT%H:%M:%SZ"
196
216
)
197
- postgres_transactions .create_item (first_item , request = MockStarletteRequest )
217
+ postgres_transactions .create_item (
218
+ first_item ["collection" ], first_item , request = MockStarletteRequest
219
+ )
198
220
199
221
second_item = load_test_data ("test_item.json" )
200
222
second_item ["id" ] = "another-item"
201
223
another_item_date = item_date - timedelta (days = 1 )
202
224
second_item ["properties" ]["datetime" ] = another_item_date .strftime (
203
225
"%Y-%m-%dT%H:%M:%SZ"
204
226
)
205
- postgres_transactions .create_item (second_item , request = MockStarletteRequest )
227
+ postgres_transactions .create_item (
228
+ second_item ["collection" ], second_item , request = MockStarletteRequest
229
+ )
206
230
207
231
params = {
208
232
"collections" : [first_item ["collection" ]],
@@ -217,7 +241,9 @@ def test_app_sort_extension(load_test_data, app_client, postgres_transactions):
217
241
218
242
def test_search_invalid_date (load_test_data , app_client , postgres_transactions ):
219
243
item = load_test_data ("test_item.json" )
220
- postgres_transactions .create_item (item , request = MockStarletteRequest )
244
+ postgres_transactions .create_item (
245
+ item ["collection" ], item , request = MockStarletteRequest
246
+ )
221
247
222
248
params = {
223
249
"datetime" : "2020-XX-01/2020-10-30" ,
@@ -230,7 +256,9 @@ def test_search_invalid_date(load_test_data, app_client, postgres_transactions):
230
256
231
257
def test_search_point_intersects (load_test_data , app_client , postgres_transactions ):
232
258
item = load_test_data ("test_item.json" )
233
- postgres_transactions .create_item (item , request = MockStarletteRequest )
259
+ postgres_transactions .create_item (
260
+ item ["collection" ], item , request = MockStarletteRequest
261
+ )
234
262
235
263
point = [150.04 , - 33.14 ]
236
264
intersects = {"type" : "Point" , "coordinates" : point }
@@ -247,7 +275,9 @@ def test_search_point_intersects(load_test_data, app_client, postgres_transactio
247
275
248
276
def test_datetime_non_interval (load_test_data , app_client , postgres_transactions ):
249
277
item = load_test_data ("test_item.json" )
250
- postgres_transactions .create_item (item , request = MockStarletteRequest )
278
+ postgres_transactions .create_item (
279
+ item ["collection" ], item , request = MockStarletteRequest
280
+ )
251
281
alternate_formats = [
252
282
"2020-02-12T12:30:22+00:00" ,
253
283
"2020-02-12T12:30:22.00Z" ,
@@ -269,7 +299,9 @@ def test_datetime_non_interval(load_test_data, app_client, postgres_transactions
269
299
270
300
def test_bbox_3d (load_test_data , app_client , postgres_transactions ):
271
301
item = load_test_data ("test_item.json" )
272
- postgres_transactions .create_item (item , request = MockStarletteRequest )
302
+ postgres_transactions .create_item (
303
+ item ["collection" ], item , request = MockStarletteRequest
304
+ )
273
305
274
306
australia_bbox = [106.343365 , - 47.199523 , 0.1 , 168.218365 , - 19.437288 , 0.1 ]
275
307
params = {
@@ -286,7 +318,9 @@ def test_search_line_string_intersects(
286
318
load_test_data , app_client , postgres_transactions
287
319
):
288
320
item = load_test_data ("test_item.json" )
289
- postgres_transactions .create_item (item , request = MockStarletteRequest )
321
+ postgres_transactions .create_item (
322
+ item ["collection" ], item , request = MockStarletteRequest
323
+ )
290
324
291
325
line = [[150.04 , - 33.14 ], [150.22 , - 33.89 ]]
292
326
intersects = {"type" : "LineString" , "coordinates" : line }
@@ -305,7 +339,9 @@ def test_app_fields_extension_return_all_properties(
305
339
load_test_data , app_client , postgres_transactions
306
340
):
307
341
item = load_test_data ("test_item.json" )
308
- postgres_transactions .create_item (item , request = MockStarletteRequest )
342
+ postgres_transactions .create_item (
343
+ item ["collection" ], item , request = MockStarletteRequest
344
+ )
309
345
310
346
resp = app_client .get (
311
347
"/search" , params = {"collections" : ["test-collection" ], "fields" : "properties" }
0 commit comments