Skip to content

Commit 3267a90

Browse files
authored
Fix pagination test (#3246)
1 parent 22b85ac commit 3267a90

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/test_utils_pagination.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,11 @@ def test_mocked_paginate(
6363
call("GET", "url_p3", max_retries=20, retry_on_status_codes=429, headers=mock_headers),
6464
]
6565

66-
def test_paginate_github_api(self) -> None:
67-
# Real test: paginate over huggingface repos on Github
66+
def test_paginate_hf_api(self) -> None:
67+
# Real test: paginate over huggingface models
6868
# Use enumerate and stop after first page to avoid loading all repos
69-
for num, _ in enumerate(
70-
paginate("https://api.github.com/orgs/huggingface/repos?limit=4", params={}, headers={})
71-
):
72-
if num == 6:
69+
for num, _ in enumerate(paginate("https://huggingface.co/api/models?limit=2", params={}, headers={})):
70+
if num == 5:
7371
break
7472
else:
75-
self.fail("Did not get more than 6 repos")
73+
self.fail("Did not get more than 5 repos")

0 commit comments

Comments
 (0)