コード例 #1
0
 def test__4(self):
     ''' Verify that append() ASCII-fies the path in any case '''
     self.assertEqual(
         utils_path.append("/foobar",
             six.u("'/cio\xe8'"), True),
         None
     )
     self.assertEqual(
         utils_path.append("/foobar",
             six.u("'/cio%e8'"), True),
         None
     )
コード例 #2
0
 def test_nonascii_str(self):
     ''' Test possibly_decode() with unicode string input '''
     self.assertEqual(
         utils_path.possibly_decode(six.u("cio\xe8"), 'utf-8'),
         six.u("cio\xe8")
     )
コード例 #3
0
 def test_ascii_str(self):
     ''' Test possibly_decode() with ascii string input '''
     self.assertEqual(
         utils_path.possibly_decode(six.u("abc"), 'utf-8'),
         six.u("abc")
     )
コード例 #4
0
 def test_nonascii_bytes(self):
     ''' Test possibly_decode() with unicode bytes input '''
     self.assertEqual(
         utils_path.possibly_decode(six.b('cio\xc3\xa8'), 'utf-8'),
         six.u("cio\xe8")
     )
コード例 #5
0
 def test_ascii_bytes(self):
     ''' Test possibly_decode() with ascii bytes input '''
     self.assertEqual(
         utils_path.possibly_decode(six.b('abc'), 'utf-8'),
         six.u('abc')
     )
コード例 #6
0
 def test__4(self):
     ''' Verify that append() ASCII-fies the path in any case '''
     self.assertEqual(
         utils_path.append("/foobar", six.u("'/cio\xe8'"), True), None)
     self.assertEqual(
         utils_path.append("/foobar", six.u("'/cio%e8'"), True), None)
コード例 #7
0
 def test_ascii_str(self):
     ''' Test possibly_decode() with ascii string input '''
     self.assertEqual(utils_path.possibly_decode(six.u("abc"), 'utf-8'),
                      six.u("abc"))
コード例 #8
0
 def test_nonascii_str(self):
     ''' Test possibly_decode() with unicode string input '''
     self.assertEqual(utils_path.possibly_decode(six.u("cio\xe8"), 'utf-8'),
                      six.u("cio\xe8"))
コード例 #9
0
 def test_ascii_bytes(self):
     ''' Test possibly_decode() with ascii bytes input '''
     self.assertEqual(utils_path.possibly_decode(six.b('abc'), 'utf-8'),
                      six.u('abc'))
コード例 #10
0
 def test_nonascii_bytes(self):
     ''' Test possibly_decode() with unicode bytes input '''
     self.assertEqual(
         utils_path.possibly_decode(six.b('cio\xc3\xa8'), 'utf-8'),
         six.u("cio\xe8"))