MCPcopy
hub / github.com/borgbackup/borg / test_shared

Method test_shared

src/borg/testsuite/fslocking_test.py:216–224  ·  view source on GitHub ↗
(self, lockpath)

Source from the content-addressed store, hash-verified

214
215class TestLock:
216 def test_shared(self, lockpath):
217 lock1 = Lock(lockpath, exclusive=False, id=ID1).acquire()
218 lock2 = Lock(lockpath, exclusive=False, id=ID2).acquire()
219 assert len(lock1._roster.get(SHARED)) == 2
220 assert len(lock1._roster.get(EXCLUSIVE)) == 0
221 assert not lock1._roster.empty(SHARED, EXCLUSIVE)
222 assert lock1._roster.empty(EXCLUSIVE)
223 lock1.release()
224 lock2.release()
225
226 def test_exclusive(self, lockpath):
227 with Lock(lockpath, exclusive=True, id=ID1) as lock:

Callers

nothing calls this directly

Calls 5

LockClass · 0.50
acquireMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected