def test__find_found_element(self): with open('sainsburys_cl/test/test_product_details.html') as test_html: html = BeautifulSoup(test_html.read(), HTML_PARSER) assert(_find_item(html, '.productTitleDescriptionContainer > h1') == 'Testing gizmo')
def test__find_not_found_element(self): html = BeautifulSoup('<!DOCTYPE html>', HTML_PARSER) assert(_find_item(html, '.productTitleDescriptionContainer > h1') == '')