'L{task.LoopingCall.withCount} with interval set to 0 and a delayed
call during the loop run will still call the countCallable 1 as if
no delay occurred.'

def test_withCountIntervalZeroDelay(self):

    clock = task.Clock()
    deferred = defer.Deferred()
    accumulator = []
    def foo(cnt):
        accumulator.append(cnt)
        if (len(accumulator) == 2):
            return deferred
        if (len(accumulator) > 4):
            loop.stop()
    loop = task.LoopingCall.withCount(foo)
    loop.clock = clock
    loop.start(0, now=False)
    clock.advance(0)
    self.assertEqual([1, 1], accumulator)
    clock.advance(2)
    self.assertEqual([1, 1], accumulator)
    deferred.callback(None)
    clock.advance(0)
    self.assertEqual([1, 1, 1, 1, 1], accumulator)
