def test_preserves_whitespace_when_making_links(): assert ( '<a style="word-wrap: break-word;" href="https://example.com">' 'https://example.com' '</a>\n' '\n' 'Next paragraph' ) == linkify( 'https://example.com\n' '\n' 'Next paragraph' )
def test_doesnt_make_links_out_of_invalid_urls(url): assert url == linkify(url)
def test_URLs_get_escaped(url, expected_html): assert linkify(url) == expected_html assert expected_html in HTMLEmail()(url)
def test_makes_links_out_of_URLs(url): link = '<a style="word-wrap: break-word;" href="{}">{}</a>'.format(url, url) assert (linkify(url) == link) assert link in HTMLEmail()(url)