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

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

src/g/r/gruvi-HEAD/tests/test_sync.py   gruvi(Download)
    def test_basic(self):
        lock = gruvi.Lock()
        self.assertFalse(lock.locked)
        lock.acquire()
        self.assertTrue(lock.locked)
    def test_acquire_release(self):
        lock = gruvi.Lock()
        lock.acquire()
        lock.release()
        lock.acquire()
    def test_acquire_multiple(self):
        lock = gruvi.Lock()
        lock.acquire()
        self.assertTrue(lock.locked)
        self.assertRaises(RuntimeError, lock.acquire)
    def test_release_multiple(self):
        lock = gruvi.Lock()
        self.assertRaises(RuntimeError, lock.release)
        self.assertFalse(lock.locked)
        lock.acquire()

src/g/r/gruvi-0.9.2/tests/test_sync.py   gruvi(Download)
    def test_basic(self):
        lock = gruvi.Lock()
        self.assertFalse(lock.locked)
        lock.acquire()
        self.assertTrue(lock.locked)
    def test_acquire_release(self):
        lock = gruvi.Lock()
        lock.acquire()
        lock.release()
        lock.acquire()
    def test_acquire_multiple(self):
        lock = gruvi.Lock()
        lock.acquire()
        self.assertTrue(lock.locked)
        self.assertRaises(RuntimeError, lock.acquire)
    def test_release_multiple(self):
        lock = gruvi.Lock()
        self.assertRaises(RuntimeError, lock.release)
        self.assertFalse(lock.locked)
        lock.acquire()