def test_integrated_url(self): result = add_label('toto.html', 'https://www.google.fr', 'Link : [[https://www.google.fr|link]] a Comment') self.assertEqual(result, 'Link : [[https://www.google.fr|link]] [[toto.html|(Archive)]] a Comment')
def test_special_caracters(self): link = 'http://www.python-forum.org/pythonforum/viewforum.php?f=17&sid=96a6f6cdd10e9b11c3a40a1664d6f2aa' result = add_label('toto.html', link, link) print(result) self.assertEqual(result, link + ' [[toto.html|(Archive)]]')
def test_autre(self): result = add_label('toto.html', 'https://encrypted.google.com/webhp?hl=fr', 'https://encrypted.google.com/webhp?hl=fr') self.assertEqual(result, 'https://encrypted.google.com/webhp?hl=fr [[toto.html|(Archive)]]')
def test_url_with_accent(self): result = add_label('toto.html', 'http://fr.wikipedia.org/wiki/Éléphant', 'http://fr.wikipedia.org/wiki/Éléphant') self.assertEqual(result, 'http://fr.wikipedia.org/wiki/Éléphant [[toto.html|(Archive)]]')
def test_simple_url_in_parenthesis(self): result = add_label('toto.html', 'http://wiki.april.org/w/PlanetApril', 'Link : (http://wiki.april.org/w/PlanetApril) a Comment') self.assertEqual(result, 'Link : (http://wiki.april.org/w/PlanetApril [[toto.html|(Archive)]]) a Comment')
def test_simple_url(self): result = add_label('toto.html', 'http://www.google.fr', 'Link : http://www.google.fr a Comment') self.assertEqual(result, 'Link : http://www.google.fr [[toto.html|(Archive)]] a Comment')