def testDecidBad(self): # try decoding a non integer ciphertext c = Crypto('some secret key_') plaintext = 'foo' ciphertext = c.enc(plaintext) with throwing(CryptoException): plaintext2 = c.decid(ciphertext)
def testEncDec(self): c = Crypto('some secret key_') plaintext = 'foo' ciphertext = c.enc(plaintext) plaintext2 = c.dec(ciphertext) assert plaintext == plaintext2