Merge "Tests: Add coverage for coordinator start/stop"
This commit is contained in:
commit
f340058145
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user