@@ -563,6 +563,10 @@ def test_add_upload_to_collection(crawler_auth_headers, default_org_id):
563563 assert data ["dateEarliest" ]
564564 assert data ["dateLatest" ]
565565 assert data ["defaultThumbnailName" ]
566+ assert data ["topPageOrigins" ]
567+ for origin in data ["topPageOrigins" ]
568+ assert origin ["origin" ]
569+ assert origin ["count" ]
566570
567571 # Verify it was added
568572 r = requests .get (
@@ -625,6 +629,10 @@ def test_list_collections(
625629 assert first_coll ["dateEarliest" ]
626630 assert first_coll ["dateLatest" ]
627631 assert first_coll ["defaultThumbnailName" ]
632+ assert first_coll ["topPageOrigins" ]
633+ for origin in first_coll ["topPageOrigins" ]
634+ assert origin ["origin" ]
635+ assert origin ["count" ]
628636
629637 second_coll = [coll for coll in items if coll ["name" ] == SECOND_COLLECTION_NAME ][0 ]
630638 assert second_coll ["id" ]
@@ -641,6 +649,10 @@ def test_list_collections(
641649 assert second_coll ["access" ] == "private"
642650 assert second_coll ["dateEarliest" ]
643651 assert second_coll ["dateLatest" ]
652+ assert second_coll ["topPageOrigins" ]
653+ for origin in second_coll ["topPageOrigins" ]
654+ assert origin ["origin" ]
655+ assert origin ["count" ]
644656
645657
646658def test_list_pages_in_collection (crawler_auth_headers , default_org_id ):
@@ -1137,6 +1149,10 @@ def test_list_public_collections(
11371149 assert collection ["pageCount" ] > 0
11381150 assert collection ["uniquePageCount" ] > 0
11391151 assert collection ["totalSize" ] > 0
1152+ assert collection ["topPageOrigins" ]
1153+ for origin in collection ["topPageOrigins" ]
1154+ assert origin ["origin" ]
1155+ assert origin ["count" ]
11401156
11411157 # Test non-existing slug - it should return a 404 but not reveal
11421158 # whether or not an org exists with that slug
@@ -1329,6 +1345,10 @@ def test_list_public_colls_home_url_thumbnail():
13291345 assert coll ["pageCount" ] > 0
13301346 assert coll ["uniquePageCount" ] > 0
13311347 assert coll ["totalSize" ] > 0
1348+ assert coll ["topPageOrigins" ]
1349+ for origin in coll ["topPageOrigins" ]
1350+ assert origin ["origin" ]
1351+ assert origin ["count" ]
13321352
13331353 for field in non_public_fields :
13341354 assert field not in coll
@@ -1380,6 +1400,10 @@ def test_get_public_collection(default_org_id):
13801400 assert coll ["pageCount" ] > 0
13811401 assert coll ["uniquePageCount" ] > 0
13821402 assert coll ["totalSize" ] > 0
1403+ assert coll ["topPageOrigins" ]
1404+ for origin in coll ["topPageOrigins" ]
1405+ assert origin ["origin" ]
1406+ assert origin ["count" ]
13831407
13841408 for field in NON_PUBLIC_COLL_FIELDS :
13851409 assert field not in coll
@@ -1462,6 +1486,10 @@ def test_get_public_collection_unlisted(crawler_auth_headers, default_org_id):
14621486 assert coll ["totalSize" ] > 0
14631487 assert coll ["defaultThumbnailName" ] == "orange-default.avif"
14641488 assert coll ["allowPublicDownload" ]
1489+ assert coll ["topPageOrigins" ]
1490+ for origin in coll ["topPageOrigins" ]
1491+ assert origin ["origin" ]
1492+ assert origin ["count" ]
14651493
14661494 for field in NON_PUBLIC_COLL_FIELDS :
14671495 assert field not in coll
@@ -1504,6 +1532,10 @@ def test_get_public_collection_unlisted_org_profile_disabled(
15041532 assert coll ["totalSize" ] > 0
15051533 assert coll ["defaultThumbnailName" ] == "orange-default.avif"
15061534 assert coll ["allowPublicDownload" ]
1535+ assert coll ["topPageOrigins" ]
1536+ for origin in coll ["topPageOrigins" ]
1537+ assert origin ["origin" ]
1538+ assert origin ["count" ]
15071539
15081540 for field in NON_PUBLIC_COLL_FIELDS :
15091541 assert field not in coll
0 commit comments