Esempio n. 1
0
    def test_key_not_found(self):
        other_key = Crypter.generate_key_string()
        other_crypter = Crypter(other_key)
        encryptedText = self.crypter.encrypt(TEXT)
        encryptedTextOther = other_crypter.encrypt(TEXT)
        self.assertEqual(self.crypter.decrypt(encryptedText), TEXT)
        self.assertEqual(other_crypter.decrypt(encryptedTextOther), TEXT)

        self.assertRaises(errors.KeyNotFoundError, self.crypter.decrypt,
                          encryptedTextOther)
Esempio n. 2
0
 def setUp(self):
     self.key = Crypter.generate_key_string()
     self.crypter = Crypter(self.key)