'Calling L{ClientService.stopService} twice after it has
connected (that is, stopping it while it is disconnecting)
returns a L{Deferred} each time that fires when the
disconnection has completed.'

def test_stopServiceWhileDisconnecting(self):

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