summaryrefslogtreecommitdiff
path: root/lib/thandy/tests.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-08 20:18:46 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-08 20:18:46 +0000
commitb250e05d84d6f914289a13e92285d1190c64636b (patch)
tree6c07671f36f9931000fc4dca64697004ffedb66d /lib/thandy/tests.py
parentec54f74b76b766474b375378aa5a7b752b8cf26c (diff)
Make encrypted data format handle unicode.
git-svn-id: file:///home/or/svnrepo/updater/trunk@17523 55e972cd-5a19-0410-ae62-a4d7a52db4cd
Diffstat (limited to 'lib/thandy/tests.py')
-rw-r--r--lib/thandy/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/thandy/tests.py b/lib/thandy/tests.py
index 44cbc88..1fbc4d6 100644
--- a/lib/thandy/tests.py
+++ b/lib/thandy/tests.py
@@ -55,6 +55,13 @@ class CryptoTests(unittest.TestCase):
self.assertRaises(thandy.UnknownFormat, thandy.keys.decryptSecret,
"foobar", password)
+ s2 = u"The secret word is now unicode frobbish."
+ encrypted = thandy.keys.encryptSecret(s2, password)
+ self.assertNotEquals(encrypted, s2.encode("utf-8"))
+ self.assert_(encrypted.startswith("GKEY1"))
+ self.assertEquals(s2, thandy.keys.decryptSecret(encrypted, password))
+
+
def test_keystore(self):
passwd = "umfitty noonah"
fname = tempfile.mktemp()