diff -r bd6ba326765e -r 7abe23cbfda1 cubicweb/test/unittest_crypto.py --- /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()