diff --git a/tests/test_chi_housing_authority.py b/tests/test_chi_housing_authority.py index 47c3a344c..25910c92b 100644 --- a/tests/test_chi_housing_authority.py +++ b/tests/test_chi_housing_authority.py @@ -20,7 +20,8 @@ MINUTES_URL = "http://www.thecha.org/doing-business/contracting-opportunities/view-all/Board%20Meeting" # noqa upcoming_response = file_response( - join(dirname(__file__), "files", "chi_housing_authority.html"), url=UPCOMING_URL, + join(dirname(__file__), "files", "chi_housing_authority.html"), + url=UPCOMING_URL, ) notice_response = file_response( join(dirname(__file__), "files", "chi_housing_authority_notice.html"), diff --git a/tests/test_chi_human_relations.py b/tests/test_chi_human_relations.py index 14a978efe..2b19d5bf0 100644 --- a/tests/test_chi_human_relations.py +++ b/tests/test_chi_human_relations.py @@ -27,7 +27,8 @@ spider._parse_schedule_pdf(test_pdf_response) parsed_items = sorted( - [item for item in spider._parse_documents(test_response)], key=itemgetter("start"), + [item for item in spider._parse_documents(test_response)], + key=itemgetter("start"), ) freezer.stop() diff --git a/tests/test_chi_police_retirement.py b/tests/test_chi_police_retirement.py index 420c5e440..aa1df8df7 100644 --- a/tests/test_chi_police_retirement.py +++ b/tests/test_chi_police_retirement.py @@ -60,7 +60,6 @@ def test_source(): def test_links(): - assert parsed_items[0]["links"] == [ { "href": "http://www.chipabf.org/ChicagoPolicePension/PDF/Agenda/2019/2019AGENDA01.pdf", # noqa diff --git a/tests/test_chi_ssa_19.py b/tests/test_chi_ssa_19.py index a141398b5..e9f581786 100644 --- a/tests/test_chi_ssa_19.py +++ b/tests/test_chi_ssa_19.py @@ -9,7 +9,8 @@ from city_scrapers.spiders.chi_ssa_19 import ChiSsa19Spider test_response = file_response( - join(dirname(__file__), "files", "chi_ssa_19.html"), url="https://rpba.org/ssa-19/", + join(dirname(__file__), "files", "chi_ssa_19.html"), + url="https://rpba.org/ssa-19/", ) test_detail_response = file_response( join(dirname(__file__), "files", "chi_ssa_19_detail.html"), diff --git a/tests/test_chi_ssa_24.py b/tests/test_chi_ssa_24.py index 07c03d357..274f674f3 100644 --- a/tests/test_chi_ssa_24.py +++ b/tests/test_chi_ssa_24.py @@ -9,7 +9,8 @@ from city_scrapers.spiders.chi_ssa_24 import ChiSsa24Spider test_response = file_response( - join(dirname(__file__), "files", "chi_ssa_24.html"), url="https://rpba.org/ssa-24/", + join(dirname(__file__), "files", "chi_ssa_24.html"), + url="https://rpba.org/ssa-24/", ) test_detail_response = file_response( join(dirname(__file__), "files", "chi_ssa_24_detail.html"), diff --git a/tests/test_chi_ssa_43.py b/tests/test_chi_ssa_43.py index 5a46bd42c..5011917a8 100644 --- a/tests/test_chi_ssa_43.py +++ b/tests/test_chi_ssa_43.py @@ -9,7 +9,8 @@ from city_scrapers.spiders.chi_ssa_43 import ChiSsa43Spider test_response = file_response( - join(dirname(__file__), "files", "chi_ssa_43.html"), url="https://rpba.org/ssa-43/", + join(dirname(__file__), "files", "chi_ssa_43.html"), + url="https://rpba.org/ssa-43/", ) test_detail_response = file_response( join(dirname(__file__), "files", "chi_ssa_43_detail.html"), diff --git a/tests/test_chi_ssa_54.py b/tests/test_chi_ssa_54.py index aa4a443a4..fe21d65d2 100644 --- a/tests/test_chi_ssa_54.py +++ b/tests/test_chi_ssa_54.py @@ -9,7 +9,8 @@ from city_scrapers.spiders.chi_ssa_54 import ChiSsa54Spider test_response = file_response( - join(dirname(__file__), "files", "chi_ssa_54.html"), url="https://rpba.org/ssa-54/", + join(dirname(__file__), "files", "chi_ssa_54.html"), + url="https://rpba.org/ssa-54/", ) test_detail_response = file_response( join(dirname(__file__), "files", "chi_ssa_54_detail.html"), diff --git a/tests/test_il_health_facilities.py b/tests/test_il_health_facilities.py index 4ef73f91d..71b147b1c 100644 --- a/tests/test_il_health_facilities.py +++ b/tests/test_il_health_facilities.py @@ -16,21 +16,21 @@ url="https://www2.illinois.gov/sites/hfsrb/events/Pages/Board-Meetings.aspx", ) -# The crawler for il_health_facilities grabs information from some pages that are linked to -# from the original page. As such, we need to test the adjacent links as well +# The crawler for il_health_facilities grabs information from some pages that are +# linked to from the original page. +# As such, we need to test the adjacent links as well adjacent_links = [ - "https://www2.illinois.gov/sites/hfsrb/events/Pages/March-21%202023-State-Board-Meeting.aspx", - "https://www2.illinois.gov/sites/hfsrb/events/Pages/May-9-2023-State-Board-Meeting.aspx", - "https://www2.illinois.gov/sites/hfsrb/events/Pages/June-27-2023%20State%20Board%20Meeting.aspx", - "https://www2.illinois.gov/sites/hfsrb/events/Pages/August-15-2023-State-Board-Meeting.aspx", - "https://www2.illinois.gov/sites/hfsrb/events/Pages/October-3-2023-State-Board-Meeting.aspx", - "https://www2.illinois.gov/sites/hfsrb/events/Pages/December-5-2023%20State%20Board%20Meeting.aspx", + "https://www2.illinois.gov/sites/hfsrb/events/Pages/March-21%202023-State-Board-Meeting.aspx", # noqa + "https://www2.illinois.gov/sites/hfsrb/events/Pages/May-9-2023-State-Board-Meeting.aspx", # noqa + "https://www2.illinois.gov/sites/hfsrb/events/Pages/June-27-2023%20State%20Board%20Meeting.aspx", # noqa + "https://www2.illinois.gov/sites/hfsrb/events/Pages/August-15-2023-State-Board-Meeting.aspx", # noqa + "https://www2.illinois.gov/sites/hfsrb/events/Pages/October-3-2023-State-Board-Meeting.aspx", # noqa + "https://www2.illinois.gov/sites/hfsrb/events/Pages/December-5-2023%20State%20Board%20Meeting.aspx", # noqa ] def mock_scrapy_request(link, callback): - with open( join(dirname(__file__), "files", "il_health_facilities_helper.html"), "rb" ) as f: @@ -46,7 +46,6 @@ def mock_scrapy_request(link, callback): @patch("scrapy.http.Request", mock_scrapy_request) def generate_parsed_items(): - freezer = freeze_time("2023-02-09") freezer.start() @@ -65,19 +64,16 @@ def test_num_meetings_found(): @pytest.mark.parametrize("item", parsed_items) def test_title(item): - assert item["title"] == "March 21, 2023 State Board Meeting" @pytest.mark.parametrize("item", parsed_items) def test_description(item): - assert item["description"] == "" @pytest.mark.parametrize("item", parsed_items) def test_start(item): - assert item["start"].strftime("%Y_%B_%d_%I_%M_%p") == "2023_March_21_09_00_AM" @@ -88,7 +84,6 @@ def test_end(item): @pytest.mark.parametrize("item", parsed_items) def test_time_notes(item): - assert item["time_notes"] == "" @@ -124,15 +119,15 @@ def test_source(item): def test_links(item): assert item["links"] == [ { - "href": "https://www2.illinois.gov/sites/hfsrb/events/Pages/Board-Meetings.aspx", + "href": "https://www2.illinois.gov/sites/hfsrb/events/Pages/Board-Meetings.aspx", # noqa "title": "Board and Subcommittee Meetings", }, { - "href": "https://www2.illinois.gov/sites/hfsrb/events/Pages/Previous-Meetings.aspx", + "href": "https://www2.illinois.gov/sites/hfsrb/events/Pages/Previous-Meetings.aspx", # noqa "title": "Previous Meeting", }, { - "href": "https://www2.illinois.gov/sites/hfsrb/events/Pages/Public-Hearing.aspx", + "href": "https://www2.illinois.gov/sites/hfsrb/events/Pages/Public-Hearing.aspx", # noqa "title": "Public Hearings", }, ] diff --git a/tests/test_il_procurement_policy.py b/tests/test_il_procurement_policy.py index bf8ee29f6..997c015d8 100644 --- a/tests/test_il_procurement_policy.py +++ b/tests/test_il_procurement_policy.py @@ -89,7 +89,8 @@ def test_all_day(item): # previous meeting minutes prev_url = "https://www2.illinois.gov/sites/ppb/Pages/board_minutes.aspx" test_response2 = file_response( - join(dirname(__file__), "files", "il_procurement_policy_prev.html"), url=prev_url, + join(dirname(__file__), "files", "il_procurement_policy_prev.html"), + url=prev_url, ) parsed_items_prev = sorted( [item for item in spider._prev_meetings(test_response2)], key=itemgetter("start")