def test_extract_traffic_fatalities_page_details_link_00(news_page): """Ensure page detail links are extracted from news page.""" actual = apd.extract_traffic_fatalities_page_details_link(news_page) expected = [ ('/news/traffic-fatality-2-3', 'Traffic Fatality #2', '2'), ('/news/traffic-fatality-1-4', 'Traffic Fatality #1', '1'), ('/news/traffic-fatality-72-1', 'Traffic Fatality #72', '72'), ('/news/traffic-fatality-73-2', 'Traffic Fatality #73', '73'), ('/news/traffic-fatality-71-2', 'Traffic Fatality #71', '71'), ('/news/traffic-fatality-69-3', 'Traffic Fatality #69', '69'), ] assert actual == expected
def test_extract_traffic_fatalities_page_details_link_01(): """Ensure page detail links are extracted from news page.""" news_page = """ <div class="views-field views-field-title"> <span class="field-content"> <a href="/news/traffic-fatality-59-update">Traffic Fatality #59- Update</a> </span> </div> """ actual = apd.extract_traffic_fatalities_page_details_link(news_page) expected = [('/news/traffic-fatality-59-update', 'Traffic Fatality #59', '59')] assert actual == expected