cubicweb/test/unittest_crypto.py
branch3.26
changeset 12615 7abe23cbfda1
child 12682 da36da3f89f1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb/test/unittest_crypto.py	Thu May 16 17:17:42 2019 +0200
@@ -0,0 +1,18 @@
+from unittest import TestCase
+
+from cubicweb import crypto
+
+
+class CryptoTC(TestCase):
+
+    def test_encrypt_decrypt_roundtrip(self):
+        data = {'a': u'ah', 'b': [1, 2]}
+        seed = 'ssss'
+        crypted = crypto.encrypt(data, seed)
+        decrypted = crypto.decrypt(crypted, seed)
+        self.assertEqual(decrypted, data)
+
+
+if __name__ == '__main__':
+    import unittest
+    unittest.main()