diff --git a/test/ganeti.locking_unittest.py b/test/ganeti.locking_unittest.py index 098a654b8447e17ffc0d7c4a86de4050469b9281..45c8f6d460dca74d5b112e8f78f12c17ccba2858 100755 --- a/test/ganeti.locking_unittest.py +++ b/test/ganeti.locking_unittest.py @@ -187,6 +187,10 @@ class TestPipeCondition(_ConditionTestCase): self.cond.acquire() self.assertEqual(len(self.cond._waiters), 3) self.assertEqual(self.cond._waiters, set(threads)) + + self.assertTrue(repr(self.cond).startswith("<")) + self.assertTrue("waiters=" in repr(self.cond)) + # This new thread can't acquire the lock, and thus call wait, before we # release it self._addThread(target=fn) @@ -268,6 +272,9 @@ class TestSharedLock(_ThreadedTestCase): _ThreadedTestCase.setUp(self) self.sl = locking.SharedLock("TestSharedLock") + self.assertTrue(repr(self.sl).startswith("<")) + self.assertTrue("name=TestSharedLock" in repr(self.sl)) + def testSequenceAndOwnership(self): self.assertFalse(self.sl.is_owned()) self.sl.acquire(shared=1)