예제 #1
0
 def test_decode_bytes(self):
     cases = [
         (u'%F6lk%FCrbis', u'ölkürbis'),
         (b'%F6lk%FCrbis', u'ölkürbis'.encode('iso-8859-1'))
     ]
     for input, output in cases:
         self.assertEqual(uridecode(input, encoding='iso-8859-1'), output)
예제 #2
0
 def test_uridecode(self):
     cases = [
         ('%', '%'),
         (b'%', b'%'),
         ('%ZZ', '%ZZ'),
         (b'%ZZ', b'%ZZ'),
         ('%Z', '%Z'),
         (b'%Z', b'%Z'),
         ('%Z%E3%81%82', '%Zあ'),
         ('%Z%E3%81%82a', '%Zあa')
     ]
     for input, output in cases:
         self.assertEqual(uridecode(input), output)
예제 #3
0
 def check(self, decoded, encoded, safe='', encoding='utf-8'):
     self.assertEqual(uriencode(decoded, safe, encoding), encoded)
     self.assertEqual(uridecode(encoded, encoding), decoded)