def test_decrypt(self): ciphertext = event.encrypt("some secret thing", "some password") self.assertEqual(event.decrypt(ciphertext, "some password"), "some secret thing") self.assertIsNone(event.decrypt(ciphertext, "wrong password"))
def test_encrypt(self): ciphertext = event.encrypt("some secret thing", "some password") self.assertNotEqual(ciphertext, "some secret thing")