def test_content_parser_parse_attr_wrong_css_selector(self, podcasts_page_1_html, base_url): content = ContentParser(podcasts_page_1_html, base_url) link_href = content.parse_attr('.test-cases-for-check .wrong-css-selector a', 'href') assert link_href is None
def test_content_parser_parse_attr_nav_aria_label(self, podcasts_page_1_html, base_url): content = ContentParser(podcasts_page_1_html, base_url) audio_src = content.parse_attr('nav', 'aria-label') assert audio_src == 'Page navigation example'
def test_content_parser_parse_attr_img_alt(self, podcasts_page_1_html, base_url): content = ContentParser(podcasts_page_1_html, base_url) link_href = content.parse_attr('.podcast-list .podcast-item img', 'alt') assert link_href == 'Podcast 1'
def test_content_parser_parse_attr_audio_src(self, podcasts_page_1_html, base_url): content = ContentParser(podcasts_page_1_html, base_url) audio_src = content.parse_attr('.podcast-list .podcast-item .card-body audio', 'src') assert audio_src == urljoin(base_url, '/media/podcast_1.mp3')
def test_content_parser_parse_attr_a_href(self, podcasts_page_1_html, base_url): content = ContentParser(podcasts_page_1_html, base_url) link_href = content.parse_attr('.podcast-head-info .link a', 'href') assert link_href == urljoin(base_url, '/subscribe')