def testFailedLOGIN(self):
self.server.challengers['LOGIN'] = imap4.LOGINCredentials
cAuth = imap4.LOGINAuthenticator('testuser')
self.client.registerAuthenticator(cAuth)
def misauth():
return self.client.authenticate('not the secret')
def authed():
self.authenticated = 1
def misauthed():
self.authenticated = -1
d1 = self.connected.addCallback(strip(misauth))
d1.addCallbacks(strip(authed), strip(misauthed))
d1.addCallbacks(self._cbStopClient, self._ebGeneral)
d = defer.gatherResults([self.loopback(), d1])
return d.addCallback(self._cbTestFailedLOGIN)
评论列表
文章目录