dumb test to verify utf8 encoding
This commit is contained in:
Robey Pointer 2005-12-02 04:03:05 -08:00
parent 76eafefcea
commit ee8a4e4b2b
1 changed files with 16 additions and 0 deletions

View File

@ -686,3 +686,19 @@ class SFTPTest (unittest.TestCase):
pass pass
finally: finally:
sftp.unlink(FOLDER + '/unusual.txt') sftp.unlink(FOLDER + '/unusual.txt')
def test_O_utf8(self):
"""
verify that unicode strings are encoded into utf8 correctly.
"""
f = sftp.open(FOLDER + '/something', 'w')
f.write('okay')
f.close()
try:
sftp.rename(FOLDER + '/something', FOLDER + u'/\u00fcnic\u00f8de')
sftp.open(FOLDER + '/\xc3\xbcnic\xc3\xb8\x64\x65', 'r')
except Exception, e:
self.fail('exception ' + e)
sftp.unlink(FOLDER + '/\xc3\xbcnic\xc3\xb8\x64\x65')