Skip to content

Commit a16b0ab

Browse files
Fix test_max_urls_cap to use MAX_URLS constant (#1368)
1 parent e401b78 commit a16b0ab

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

apps/crawler/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.4
1+
0.7.5

apps/crawler/tests/test_nextdata.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,14 @@ async def test_path_not_found(self):
475475
assert result == []
476476

477477
async def test_max_urls_cap(self):
478-
items = [{"id": str(i), "text": f"Job {i}"} for i in range(10_500)]
478+
from src.core.monitors.nextdata import MAX_URLS
479+
480+
items = [{"id": str(i), "text": f"Job {i}"} for i in range(MAX_URLS + 500)]
479481
data = {"props": {"pageProps": {"positions": items}}}
480482
html = _html_with_next_data(data)
481483
async with httpx.AsyncClient(transport=_mock_transport(html)) as client:
482484
result = await discover(BOARD_URL_ONLY, client)
483-
assert len(result) <= 10_000
485+
assert len(result) <= MAX_URLS
484486

485487
async def test_missing_path_config(self):
486488
board = {

0 commit comments

Comments
 (0)