Commit 1db0fdcf authored by Łukasz Nowak's avatar Łukasz Nowak

fixup! updater: Implement prepare system

parent 86b0021f
......@@ -1428,11 +1428,12 @@ class KedifaUpdaterLoopTest(
self.assertFalse(os.path.exists(lock_file))
self.assertFalse(os.path.exists(self.state))
with mock.patch.object(
updater.Updater, 'prepare') as mock_object:
updater.Updater, 'prepare') as mock_prepare:
with mock.patch.object(
updater.Updater, 'action', return_value=None) as mock_object:
updater.Updater, 'action', return_value=None) as mock_action:
u.loop()
mock_object.assert_called()
mock_prepare.assert_called()
mock_action.assert_called()
self.assertFalse(os.path.exists(lock_file))
self.assertFalse(os.path.exists(self.state))
......@@ -1472,13 +1473,14 @@ class KedifaUpdaterLoopTest(
self.assertFalse(os.path.exists(lock_file))
self.assertFalse(os.path.exists(self.state))
with mock.patch.object(
updater.Updater, 'prepare', return_value=None) as mock_object:
updater.Updater, 'prepare', return_value=None) as mock_prepare:
with mock.patch.object(
updater.Updater, 'action', return_value=None) as mock_object:
updater.Updater, 'action', return_value=None) as mock_action:
with mock.patch.object(
updater.time, 'sleep', side_effect=ValueError('timer')) as timer:
self.assertRaises(ValueError, u.loop)
timer.assert_called_with(1)
mock_object.assert_called()
mock_prepare.assert_called()
mock_action.assert_called()
self.assertFalse(os.path.exists(lock_file))
self.assertFalse(os.path.exists(self.state))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment