File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,11 +73,12 @@ async def test_store_list_sort_by_popularity(client: ApifyClient | ApifyClientAs
7373 page = await maybe_await (client .store ().list (limit = 10 , sort_by = 'popularity' ))
7474 assert isinstance (page , ListOfStoreActors )
7575 assert len (page .items ) > 0
76- # `total_users` is the strongest single-field proxy for popularity in the public store —
77- # verify the result is at least non-increasing in that metric (ties allowed).
76+ # `popularity` is a composite ranking, not a strict sort on any single field, so we only
77+ # check the directional invariant: the top-ranked item has at least as many total users as
78+ # the bottom-ranked one on the page.
7879 total_users = [a .stats .total_users for a in page .items if a .stats .total_users is not None ]
7980 assert total_users , 'expected at least one item with populated stats.total_users'
80- assert total_users == sorted ( total_users , reverse = True )
81+ assert total_users [ 0 ] >= total_users [ - 1 ]
8182
8283
8384async def test_store_iterate (client : ApifyClient | ApifyClientAsync , * , is_async : bool ) -> None :
You can’t perform that action at this time.
0 commit comments