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 )
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") )
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") )
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") )
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') )
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)
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"))
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"))
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'))
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"))