def testCheckPassword(self): c = credentials.CramMD5Credentials() chal = c.getChallenge() c.response = hmac.HMAC('secret', chal).hexdigest() self.failUnless(c.checkPassword('secret'))
def testWrongPassword(self): c = credentials.CramMD5Credentials() self.failIf(c.checkPassword('secret'))
def testIdempotentChallenge(self): c = credentials.CramMD5Credentials() chal = c.getChallenge() self.assertEqual(chal, c.getChallenge())