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)
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)
def test_encrypt_small_text(self): from mootiro_web.crypto import encrypt text = ' hi ' encrypted = encrypt(text, self.rsa_key)