'If the encrypted password provided by the getpwnam function is valid
(verified by the L{verifyCryptedPassword} function), we callback the
C{requestAvatarId} L{Deferred} with the username.'

def test_verifyPassword(self):

    def verifyCryptedPassword(crypted, pw):
        return (crypted == pw)
    def getpwnam(username):
        return [username, username]
    self.patch(checkers, 'verifyCryptedPassword', verifyCryptedPassword)
    checker = checkers.UNIXPasswordDatabase([getpwnam])
    credential = UsernamePassword('username', 'username')
    self.assertLoggedIn(checker.requestAvatarId(credential), 'username')
