MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_list_all_locks

Method test_list_all_locks

ci/tests/test_lock_database.py:58–67  ·  view source on GitHub ↗

Returns all lock records with correct metadata.

(self)

Source from the content-addressed store, hash-verified

56 self.assertFalse(released)
57
58 def test_list_all_locks(self) -> None:
59 """Returns all lock records with correct metadata."""
60 pid = os.getpid()
61 self.db.try_acquire("lock_a", pid, "host1", "op_a")
62 self.db.try_acquire("lock_b", pid, "host1", "op_b")
63
64 all_locks = self.db.list_all_locks()
65 self.assertEqual(len(all_locks), 2)
66 names = {lock["lock_name"] for lock in all_locks}
67 self.assertEqual(names, {"lock_a", "lock_b"})
68
69
70class TestReadLockShared(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

list_all_locksMethod · 0.80
try_acquireMethod · 0.45

Tested by

no test coverage detected