def testEncidBad(self): # try encoding a non integer c = Crypto('some secret key_') plaintext = 'foo' with throwing(CryptoException): ciphertext = c.encid(plaintext)
def testEncidDecid(self): c = Crypto('some secret key_') plaintext = 1 ciphertext = c.encid(plaintext) plaintext2 = c.decid(ciphertext) assert plaintext == plaintext2