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 55
66from ..conftest import create_collection , delete_collections_and_items , refresh_indices
77
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+
824
925@pytest .mark .asyncio
1026async def test_create_and_delete_collection (app_client , load_test_data ):
@@ -98,6 +114,18 @@ async def test_collection_extensions(ctx, app_client):
98114 assert resp .json ().get ("item_assets" , {}).get ("test" ) == test_asset
99115
100116
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+
101129@pytest .mark .asyncio
102130async def test_pagination_collection (app_client , ctx , txn_client ):
103131 """Test collection pagination links"""
You can’t perform that action at this time.
0 commit comments