def test_link_unicode(self): self.assertEqual( c2h.linkify(u'see http://example.com/?q=ünicøde for more'), u'see <a href="http://example.com/?q=ünicøde">' u'http://example.com/?q=ünicøde</a> for more', )
def test_link_with_quotes(self): self.assertEqual( c2h.linkify('see http://example.com/?q="a" for more'), 'see <a href="http://example.com/?q="a"">' 'http://example.com/?q="a"</a> for more', )
def test_launchpad_bug(self): self.assertEqual( c2h.linkify('# LP: #12345'), '# <a href="https://pad.lv/12345">LP: #12345</a>', )
def test_link_in_parens(self): self.assertEqual( c2h.linkify('see [link](http://example.com)'), 'see [link](<a href="http://example.com">http://example.com</a>)', )
def test_link_with_ampersands(self): self.assertEqual( c2h.linkify('see http://example.com/?q=a&b for more'), 'see <a href="http://example.com/?q=a&b">' 'http://example.com/?q=a&b</a> for more', )
def test_html(self): self.assertEqual(c2h.linkify('<he&lo>'), '<he&lo>')
def test_link(self): self.assertEqual( c2h.linkify('see http://example.com for more'), 'see <a href="http://example.com">http://example.com</a> for more', )
def test(self): self.assertEqual(c2h.linkify('hello'), 'hello')