def test_clientConnectionFailed(self):
"""
Calls to L{_WrappingFactory.clientConnectionLost} should errback the
L{_WrappingFactory._onConnection} L{Deferred}
"""
wf = endpoints._WrappingFactory(TestFactory())
expectedFailure = Failure(error.ConnectError(string="fail"))
wf.clientConnectionFailed(None, expectedFailure)
errors = []
def gotError(f):
errors.append(f)
wf._onConnection.addErrback(gotError)
self.assertEqual(errors, [expectedFailure])
评论列表
文章目录