fix: adjust exponential backoff timing in scrape_jobs_with_retry
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user