def test_AES(self): cipher = AESCipher() string = "The quick brown fox jumps over the lazy dog." ct = cipher.encrypt(string) self.assertNotEqual(ct, string) pt = cipher.decrypt(ct) self.assertEqual(pt, string)
def test_AES_error(self): cipher = AESCipher() string = "The quick brown fox jumps over the lazy dog." ct = cipher.encrypt(string)[:10] + "randomgarbage" self.assertRaises(TypeError, cipher.decrypt, ct)