def test_startServiceWhileStopped(self):
"""
When L{ClientService} is stopped - that is,
L{ClientService.stopService} has been called and the L{Deferred} it
returns has fired - calling L{startService} will cause a new connection
to be made, and new calls to L{whenConnected} to succeed.
"""
cq, service = self.makeReconnector(fireImmediately=False)
stopped = service.stopService()
self.successResultOf(stopped)
self.failureResultOf(service.whenConnected(), CancelledError)
service.startService()
cq.connectQueue[-1].callback(None)
self.assertIdentical(cq.applicationProtocols[-1],
self.successResultOf(service.whenConnected()))
评论列表
文章目录