Skip to content

Commit

Permalink
Update members scraper so that it can run against live data sources
Browse files Browse the repository at this point in the history
The test fixture used in this case was different from the live source. I've replaced it with a copy of the original source.
  • Loading branch information
tillprochaska committed Nov 17, 2024
1 parent 1adbaac commit 8b64299
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
10 changes: 0 additions & 10 deletions backend/tests/scrapers/data/members/members_directory_term_8.xml

This file was deleted.

18 changes: 1 addition & 17 deletions backend/tests/scrapers/data/members/members_directory_term_9.xml

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions backend/tests/scrapers/test_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
TEST_DATA_DIR = Path(__file__).resolve().parent / "data"


@pytest.mark.always_mock_requests
def test_members_scraper(responses):
responses.get(
"https://www.europarl.europa.eu/meps/en/directory/xml/?leg=9",
Expand All @@ -20,10 +19,10 @@ def test_members_scraper(responses):
scraper = MembersScraper(term=9)
fragments = scraper.run()

assert len(fragments) == 2
assert fragments[0].group_key == 1
assert len(fragments) == 875
assert fragments[0].group_key == 197490
assert fragments[0].data.get("term") == 9
assert fragments[1].group_key == 2
assert fragments[1].group_key == 189525
assert fragments[1].data.get("term") == 9


Expand Down

0 comments on commit 8b64299

Please sign in to comment.