fix: adjust exponential backoff timing in scrape_jobs_with_retry
Some checks failed
CI/CD Pipeline / test (push) Failing after 42s
CI/CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
2025-11-01 18:31:35 +01:00
parent f48f5dc036
commit 92b6efb550
2 changed files with 3 additions and 3 deletions

View File

@@ -8,14 +8,14 @@ class TestScheduler:
def test_scrape_jobs_with_retry_success(self):
"""Test that scrape_jobs_with_retry succeeds on first attempt."""
with patch('web.craigslist.scrape_jobs') as mock_scrape:
with patch('web.craigslist.scraper') as mock_scrape:
result = scrape_jobs_with_retry()
assert result is True
mock_scrape.assert_called_once()
def test_scrape_jobs_with_retry_failure(self):
"""Test that scrape_jobs_with_retry handles failures properly."""
with patch('web.craigslist.scrape_jobs', side_effect=Exception("Test error")) as mock_scrape:
with patch('web.craigslist.scraper', side_effect=Exception("Test error")) as mock_scrape:
result = scrape_jobs_with_retry(max_retries=2)
assert result is False
assert mock_scrape.call_count == 2