Exemple #1
0
 def test_encrypt_format(self):
     from mootiro_web.crypto import encrypt
     text = '   This is just a simple test   '
     encrypted = encrypt(text, self.rsa_key)
     self.assertIn('"content":', encrypted)
     self.assertIn('"key":', encrypted)
Exemple #2
0
 def test_encrypt_n_decrypt(self):
     from mootiro_web.crypto import encrypt, decrypt
     text = '   This is just a simple test   '
     encrypted = encrypt(text, self.rsa_key)
     decrypted = decrypt(encrypted, self.rsa_key)
     self.assertEqual(decrypted, text)
Exemple #3
0
 def test_encrypt_small_text(self):
     from mootiro_web.crypto import encrypt
     text = '   hi   '
     encrypted = encrypt(text, self.rsa_key)