'When cancel a L{defer.Deferred} returned by
L{defer.DeferredFilesystemLock.deferUntilLocked}, if the timeout is
set, the timeout call will be cancelled.'

def test_cancelDeferUntilLockedWithTimeout(self):

    self.lock.lock()
    deferred = self.lock.deferUntilLocked(timeout=1)
    timeoutCall = self.lock._timeoutCall
    deferred.cancel()
    self.assertFalse(timeoutCall.active())
    self.assertIsNone(self.lock._timeoutCall)
    self.failureResultOf(deferred, defer.CancelledError)
