def test_wrongPassword(self): """ Calling C{checkPassword} on a L{UsernameHashedPassword} will return L{False} when the password given is NOT the password on the object. """ creds = UsernameHashedPassword(b"user", b"pass") self.assertFalse(creds.checkPassword(b"someotherpass"))
def test_correctPassword(self): """ Calling C{checkPassword} on a L{UsernameHashedPassword} will return L{True} when the password given is the password on the object. """ creds = UsernameHashedPassword(b"user", b"pass") self.assertTrue(creds.checkPassword(b"pass"))