Merge "Tests: Add coverage for coordinator start/stop"

This commit is contained in:
Zuul 2021-06-24 03:04:22 +00:00 committed by Gerrit Code Review
commit f340058145

View File

@ -55,6 +55,9 @@ class CoordinatorTestCase(test.TestCase):
self.assertTrue(get_coordinator.called)
self.assertTrue(crd.start.called)
agent.start()
crd.start.assert_called_once_with(start_heart=True)
def test_coordinator_stop(self, get_coordinator):
crd = get_coordinator.return_value
@ -65,6 +68,9 @@ class CoordinatorTestCase(test.TestCase):
self.assertTrue(crd.stop.called)
self.assertIsNone(agent.coordinator)
agent.stop()
crd.stop.assert_called_once_with()
def test_coordinator_lock(self, get_coordinator):
crd = get_coordinator.return_value
crd.get_lock.side_effect = lambda n: MockToozLock(n)