cubicweb/test/unittest_crypto.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Tue, 25 Jun 2019 16:21:41 +0200
branch3.26
changeset 12669 f035fa5a6e67
parent 12615 7abe23cbfda1
child 12682 da36da3f89f1
permissions -rw-r--r--
[debian] Make descriptions of python-cubicweb and python3-cubicweb uniform Thus solving lintian warning "description-synopsis-starts-with-article".

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()