Exemplo n.º 1
0
    def test_iri_to_uri(self):
        self.assertEqual(iri_to_uri('red%09ros\xe9#red'),
            'red%09ros%C3%A9#red')

        self.assertEqual(iri_to_uri('/blog/for/J\xfcrgen M\xfcnster/'),
            '/blog/for/J%C3%BCrgen%20M%C3%BCnster/')

        self.assertEqual(iri_to_uri('locations/%s' % urlquote_plus('Paris & Orl\xe9ans')),
            'locations/Paris+%26+Orl%C3%A9ans')
Exemplo n.º 2
0
 def test_urlquote(self):
     self.assertEqual(urlquote('Paris & Orl\xe9ans'),
         'Paris%20%26%20Orl%C3%A9ans')
     self.assertEqual(urlquote('Paris & Orl\xe9ans', safe="&"),
         'Paris%20&%20Orl%C3%A9ans')
     self.assertEqual(
         urlunquote('Paris%20%26%20Orl%C3%A9ans'),
         'Paris & Orl\xe9ans')
     self.assertEqual(
         urlunquote('Paris%20&%20Orl%C3%A9ans'),
         'Paris & Orl\xe9ans')
     self.assertEqual(urlquote_plus('Paris & Orl\xe9ans'),
         'Paris+%26+Orl%C3%A9ans')
     self.assertEqual(urlquote_plus('Paris & Orl\xe9ans', safe="&"),
         'Paris+&+Orl%C3%A9ans')
     self.assertEqual(
         urlunquote_plus('Paris+%26+Orl%C3%A9ans'),
         'Paris & Orl\xe9ans')
     self.assertEqual(
         urlunquote_plus('Paris+&+Orl%C3%A9ans'),
         'Paris & Orl\xe9ans')