def test_assert_link(): h = HtmlAssertions() h.html = '<html><a href="/abc">Some Text</a></html>' h.assert_link(text='Some Text', href='/abc')
def test_assert_link_fail_wrong_href(): h = HtmlAssertions() h.html = '<html><a href="/abc">Some Text</a></html>' with pytest.raises(AssertionError): h.assert_link(text='Some Text', href='/xyz')