Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_seed_cachelock.py   MapProxy(Download)
    def test_free_lock(self):
        locker = CacheLocker(self.lock_file)
        with locker.lock('foo'):
            assert True
 
    def test_locked_by_process_no_block(self):
        proc_is_locked = multiprocessing.Event()
        def lock():
            locker = CacheLocker(self.lock_file)
            with locker.lock('foo'):
 
        # test unlocked bar
        with locker.lock('bar', no_block=True):
            assert True
 
        # test locked foo
        try:
            with locker.lock('foo', no_block=True):
        def lock():
            locker = CacheLocker(self.lock_file)
            with locker.lock('foo'):
                proc_is_locked.set()
                time.sleep(.1)

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_seed_cachelock.py   mapproxy(Download)
    def test_free_lock(self):
        locker = CacheLocker(self.lock_file)
        with locker.lock('foo'):
            assert True
 
    def test_locked_by_process_no_block(self):
        proc_is_locked = multiprocessing.Event()
        def lock():
            locker = CacheLocker(self.lock_file)
            with locker.lock('foo'):
 
        # test unlocked bar
        with locker.lock('bar', no_block=True):
            assert True
 
        # test locked foo
        try:
            with locker.lock('foo', no_block=True):
        def lock():
            locker = CacheLocker(self.lock_file)
            with locker.lock('foo'):
                proc_is_locked.set()
                time.sleep(.1)