twisted.internet.defer.AlreadyTryingToLockError

Here are the examples of the python api twisted.internet.defer.AlreadyTryingToLockError taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 Source : test_defer.py
with MIT License
from autofelix

    def test_concurrentUsage(self):
        """
        Test that an appropriate exception is raised when attempting
        to use deferUntilLocked concurrently.
        """
        self.lock.lock()
        self.clock.callLater(1, self.lock.unlock)

        d = self.lock.deferUntilLocked()
        d2 = self.lock.deferUntilLocked()

        self.assertFailure(d2, defer.AlreadyTryingToLockError)

        self.clock.advance(1)

        return d


    def test_multipleUsages(self):