def testPercent(self): self.mock_pwd_file() pwd = 'abc%%def' self.assertEqual( Password.decrypt(Password.encrypt(pwd)), pwd)
def testBackslash(self): self.mock_pwd_file() pwd = 'abc\\def' self.assertEqual( Password.decrypt(Password.encrypt(pwd)), pwd)
def testBoth(self): self.mock_pwd_file() pwd = "Test password" encrypted = Password.encrypt(pwd) self.assertEqual(pwd, Password.decrypt(encrypted))
def testCryptedPasswordWithoutKey(self): Password.KEYFILE = "/some/nonexistant/file" # passwd = "TestSecretPassword!" with self.assertRaises(InvalidKeyFile): Password.decrypt(unhexlify("06a9214036b8a15b512e03d534120006"))
def testCryptedPasswordWithoutKey(self): Password.KEYFILE = "/some/nonexistant/file" # passwd = "TestSecretPassword!" with self.assertRaises(InvalidKeyFile): Password.decrypt(unhexlify("06a9214036b8a15b512e03d534120006"))
def test_unicode(self): self.mock_pwd_file() pwd = u'‣' self.assertEqual(Password.decrypt(Password.encrypt(pwd)), pwd)
def test_unicode(self): self.mock_pwd_file() pwd = u'‣' self.assertEqual(Password.decrypt(Password.encrypt(pwd)), pwd)