-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
191c7e3
commit 30eb634
Showing
4 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
import pytest | ||
from pathlib import Path | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
from clean.runner import Runner | ||
|
||
|
||
@pytest.fixture | ||
def runner(tmp_path): | ||
return Runner(data_dir=tmp_path / "exports", cache_dir=tmp_path / "cache") | ||
|
||
|
||
def test_scrape_meta(runner): | ||
# Call the scrape_meta method with a valid agency slug | ||
with patch("clean.ca.san_diego_pd.Site.scrape_meta") as mock_scrape_meta: | ||
runner.scrape_meta("ca_san_diego_pd") | ||
# Assert that the scrape_meta method was called | ||
mock_scrape_meta.assert_called_once_with(throttle=0) | ||
|
||
|
||
def test_scrape(runner): | ||
with patch("clean.ca.san_diego_pd.Site.scrape") as mock_scrape: | ||
runner.scrape("ca_san_diego_pd") | ||
# Assert that the scrape method was called | ||
mock_scrape.assert_called_once_with(throttle=0, filter='') | ||
mock_scrape.assert_called_once_with(throttle=0, filter="") |