2424 file_lineage , file_metadata ,
2525 file_metadata_object , file_path ,
2626 folder_lineage , folder_metadata ,
27- folder_children_metadata , folder_path ,
27+ folder_children_metadata , folder_children_metadata_minimal , folder_path ,
2828 revisions_metadata , revision_metadata_object ,
2929 download_response , download_path ,
3030 upload_response , upload_path , root_path ,
@@ -210,7 +210,7 @@ async def test_delete_folder_contents(self, provider_one, file_path, folder_path
210210
211211 children_url , params = build_signed_url_without_auth (provider_one , 'GET' ,
212212 folder_path .identifier , 'children' ,
213- user_id = provider_one .auth ['id' ])
213+ user_id = provider_one .auth ['id' ], minimal = False )
214214 aiohttpretty .register_json_uri ('GET' , children_url , params = params , status = 200 ,
215215 body = folder_children_metadata )
216216
@@ -227,7 +227,7 @@ class TestMetadata:
227227 async def test_provider_metadata_empty (self , provider_one , folder_path , mock_time ):
228228
229229 url , params = build_signed_url_without_auth (provider_one , 'GET' , folder_path .identifier ,
230- 'children' , user_id = provider_one .auth ['id' ])
230+ 'children' , user_id = provider_one .auth ['id' ], minimal = False )
231231 aiohttpretty .register_json_uri ('GET' , url , params = params , status_code = 200 , body = [])
232232
233233 res = await provider_one .metadata (folder_path )
@@ -241,7 +241,7 @@ async def test_provider_metadata_folder(self, provider_one, folder_path,
241241 folder_children_metadata , mock_time ):
242242
243243 url , params = build_signed_url_without_auth (provider_one , 'GET' , folder_path .identifier ,
244- 'children' , user_id = provider_one .auth ['id' ])
244+ 'children' , user_id = provider_one .auth ['id' ], minimal = False )
245245 aiohttpretty .register_json_uri ('GET' , url , params = params , status = 200 ,
246246 body = folder_children_metadata )
247247
@@ -276,7 +276,7 @@ async def test_provider_metadata_without_id(self, provider_one, folder_path,
276276 folder_children_metadata , mock_time ):
277277
278278 url , params = build_signed_url_without_auth (provider_one , 'GET' , folder_path .identifier ,
279- 'children' )
279+ 'children' , minimal = False )
280280 aiohttpretty .register_json_uri ('GET' , url , params = params , status = 200 ,
281281 body = folder_children_metadata )
282282 folder_path ._parts [- 1 ]._id = None
@@ -732,7 +732,7 @@ async def test_validate_path_404s(self, provider_one, file_lineage, mock_time):
732732 async def test_revalidate_path_new (self , provider_one , folder_path , folder_children_metadata ,
733733 mock_time ):
734734 url , params = build_signed_url_without_auth (provider_one , 'GET' , folder_path .identifier ,
735- 'children' , user_id = provider_one .auth ['id' ])
735+ 'children' , user_id = provider_one .auth ['id' ], minimal = False )
736736 aiohttpretty .register_json_uri ('GET' , url , params = params , status = 200 ,
737737 body = folder_children_metadata )
738738
@@ -745,7 +745,7 @@ async def test_revalidate_path_new(self, provider_one, folder_path, folder_child
745745 async def test_revalidate_path_existing (self , provider_one , folder_path ,
746746 folder_children_metadata , mock_time ):
747747 url , params = build_signed_url_without_auth (provider_one , 'GET' , folder_path .identifier ,
748- 'children' , user_id = provider_one .auth ['id' ])
748+ 'children' , user_id = provider_one .auth ['id' ], minimal = False )
749749 aiohttpretty .register_json_uri ('GET' , url , params = params , status = 200 ,
750750 body = folder_children_metadata )
751751
@@ -1253,3 +1253,21 @@ async def test_intra_copy_reject_by_quota(self, provider_one, auth, credentials,
12531253 src_provider .can_intra_copy .assert_called_once_with (dst_provider , src_path )
12541254 src_provider .intra_copy .assert_not_called ()
12551255 src_provider .download .assert_not_called ()
1256+
1257+ class TestMinimalMetadataDAZ :
1258+
1259+ @pytest .mark .asyncio
1260+ @pytest .mark .aiohttpretty
1261+ async def test_minimal_metadata (self , provider_one , folder_path , folder_children_metadata_minimal ):
1262+
1263+ url , params = build_signed_url_without_auth (provider_one , 'GET' , folder_path .identifier ,
1264+ 'children' , user_id = provider_one .auth ['id' ], minimal = True )
1265+ aiohttpretty .register_json_uri ('GET' , url , params = params , status = 200 ,
1266+ body = folder_children_metadata_minimal )
1267+
1268+ metadata = await provider_one .metadata (folder_path , minimal = True )
1269+
1270+ assert [type (metadata_item ) for metadata_item in metadata ] == [OsfStorageFolderMetadata , OsfStorageFileMetadata , OsfStorageFileMetadata , OsfStorageFileMetadata ]
1271+ assert [metadata_item .name for metadata_item in metadata ] == ['New Folder' , 'one' , 'doc.rst' , 'video.mp4' ]
1272+ assert [metadata_item .path for metadata_item in metadata ] == ['/59c0054cb7d1c90114c456af/' , '/59a9b637b7d1c903ab5a8f58' , '/59a9b628b7d1c903ab5a8f52' , '/59a5adb9b7d1c901cd40f0e9' ]
1273+ assert [metadata_item .provider for metadata_item in metadata ] == ['osfstorage' , 'osfstorage' , 'osfstorage' , 'osfstorage' ]
0 commit comments