File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
stac_fastapi/elasticsearch/tests/resources Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
from ..conftest import create_collection , delete_collections_and_items , refresh_indices
7
7
8
+ CORE_COLLECTION_PROPS = [
9
+ "id" ,
10
+ "type" ,
11
+ "stac_extensions" ,
12
+ "stac_version" ,
13
+ "title" ,
14
+ "description" ,
15
+ "keywords" ,
16
+ "license" ,
17
+ "providers" ,
18
+ "summaries" ,
19
+ "extent" ,
20
+ "links" ,
21
+ "assets" ,
22
+ ]
23
+
8
24
9
25
@pytest .mark .asyncio
10
26
async def test_create_and_delete_collection (app_client , load_test_data ):
@@ -98,6 +114,18 @@ async def test_collection_extensions(ctx, app_client):
98
114
assert resp .json ().get ("item_assets" , {}).get ("test" ) == test_asset
99
115
100
116
117
+ @pytest .mark .asyncio
118
+ async def test_collection_defaults (app_client ):
119
+ """Test that properties omitted by client are populated w/ default values"""
120
+ minimal_coll = {"id" : str (uuid .uuid4 ())}
121
+ resp = await app_client .post ("/collections" , json = minimal_coll )
122
+
123
+ assert resp .status_code == 200
124
+ resp_json = resp .json ()
125
+ for prop in CORE_COLLECTION_PROPS :
126
+ assert prop in resp_json .keys ()
127
+
128
+
101
129
@pytest .mark .asyncio
102
130
async def test_pagination_collection (app_client , ctx , txn_client ):
103
131
"""Test collection pagination links"""
You can’t perform that action at this time.
0 commit comments