def test_find_nested_empty_tag(fake_html_3): soup = Soup(fake_html_3) result = soup.find("a", {"class": "foo"}) if len(result) != 2: raise AssertionError
def test_find_nested_groups(fake_html_2): soup = Soup(fake_html_2) results = soup.find("div", {"class": "foo"}) if len(results) != 2: raise AssertionError
def test_find_partial_false(fake_html_2): soup = Soup(fake_html_2) result = soup.find("div", {"class": "foo"}, partial=False, mode="all") if len(result) != 1: raise AssertionError
def test_find_text(fake_html_1): soup = Soup(fake_html_1) result = soup.find("p", {"id": "blarg"}) if result.text != "Try for 2": raise AssertionError
def test_find_with_attrs(fake_html_1): soup = Soup(fake_html_1) result = soup.find("p", {"id": "blarg"}) if str(result) != '<p id="blarg">Try for 2</p>': raise AssertionError
def test_find_first(fake_html_1): soup = Soup(fake_html_1) result = soup.find("p", mode="first") if str(result) != "<p>'IDK!'</p>": raise AssertionError
def test_find(fake_html_1): soup = Soup(fake_html_1) result = soup.find("span") if str(result) != "<span>Hi</span>": raise AssertionError
def test_find_inner_text(): html = """<p>£600m</p>""" soup = Soup(html) result = soup.text if result != "£600m": raise AssertionError