'Calling L{ClientService.stopService} after calling a
reconnection attempt returns a L{Deferred} that fires when the
disconnection has completed.'

def test_stopServiceWhileRestarting(self):

    clock = Clock()
    (cq, service) = self.makeReconnector(fireImmediately=False, clock=clock)
    cq.connectQueue[0].callback(None)
    firstStopDeferred = service.stopService()
    service.startService()
    secondStopDeferred = service.stopService()
    cq.constructedProtocols[0].connectionLost(Failure(IndentationError()))
    self.successResultOf(firstStopDeferred)
    self.successResultOf(secondStopDeferred)
