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=&quot;a&quot;">'
         'http://example.com/?q=&quot;a&quot;</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&amp;b">'
         'http://example.com/?q=a&amp;b</a> for more',
     )
 def test_html(self):
     self.assertEqual(c2h.linkify('<he&lo>'), '&lt;he&amp;lo&gt;')
 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',
     )
Exemplo n.º 8
0
 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(self):
     self.assertEqual(c2h.linkify('hello'), 'hello')
Exemplo n.º 10
0
 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=&quot;a&quot;">'
         'http://example.com/?q=&quot;a&quot;</a> for more',
     )
Exemplo n.º 11
0
 def test_launchpad_bug(self):
     self.assertEqual(
         c2h.linkify('# LP: #12345'),
         '# <a href="https://pad.lv/12345">LP: #12345</a>',
     )
Exemplo n.º 12
0
 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&amp;b">'
         'http://example.com/?q=a&amp;b</a> for more',
     )
Exemplo n.º 13
0
 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>)',
     )
Exemplo n.º 14
0
 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',
     )
Exemplo n.º 15
0
 def test_html(self):
     self.assertEqual(c2h.linkify('<he&lo>'), '&lt;he&amp;lo&gt;')
Exemplo n.º 16
0
 def test(self):
     self.assertEqual(c2h.linkify('hello'), 'hello')