branch | 3.26 |
changeset 12615 | 7abe23cbfda1 |
child 12682 | da36da3f89f1 |
12605:bd6ba326765e | 12615:7abe23cbfda1 |
---|---|
1 from unittest import TestCase |
|
2 |
|
3 from cubicweb import crypto |
|
4 |
|
5 |
|
6 class CryptoTC(TestCase): |
|
7 |
|
8 def test_encrypt_decrypt_roundtrip(self): |
|
9 data = {'a': u'ah', 'b': [1, 2]} |
|
10 seed = 'ssss' |
|
11 crypted = crypto.encrypt(data, seed) |
|
12 decrypted = crypto.decrypt(crypted, seed) |
|
13 self.assertEqual(decrypted, data) |
|
14 |
|
15 |
|
16 if __name__ == '__main__': |
|
17 import unittest |
|
18 unittest.main() |