def test_mutex_lock_twice_same_instance(self): "Double lock (on same instance) causes an error" mutex = Mutex(id='mutex-01') mutex.lock() self.assertRaises(MutexLockedException, mutex.lock) mutex.graceful_release('mutex-01')
def test_mutex_unlock_not_locked(self): "Release an unlocked Mutex causes an error" mutex = Mutex(id='mutex-01') self.assertRaises(MutexNotLockedException, mutex.release) mutex.graceful_release('mutex-01')
def tearDown(self): # super(MutexTestCase, self).tearDown() super().tearDown() Mutex.graceful_release('dummy_lock')
def tearDown(self): super().tearDown() Mutex.graceful_release('dummy_lock')