forked from openlp/openlp
Patch Registry.execute so that it is undoen at end of test
This commit is contained in:
parent
2555bc50d4
commit
9a1ce000b7
@ -508,7 +508,7 @@ class TestSlideController(TestCase):
|
||||
mocked_update_preview = MagicMock()
|
||||
mocked_preview_widget = MagicMock()
|
||||
mocked_slide_selected = MagicMock()
|
||||
Registry.execute = mocked_execute
|
||||
with patch.object(Registry, 'execute') as mocked_execute:
|
||||
Registry.create()
|
||||
slide_controller = SlideController(None)
|
||||
slide_controller.service_item = mocked_item
|
||||
@ -539,7 +539,7 @@ class TestSlideController(TestCase):
|
||||
mocked_update_preview = MagicMock()
|
||||
mocked_preview_widget = MagicMock()
|
||||
mocked_slide_selected = MagicMock()
|
||||
Registry.execute = mocked_execute
|
||||
with patch.object(Registry, 'execute') as mocked_execute:
|
||||
Registry.create()
|
||||
slide_controller = SlideController(None)
|
||||
slide_controller.service_item = mocked_item
|
||||
@ -556,3 +556,5 @@ class TestSlideController(TestCase):
|
||||
self.assertEqual(0, mocked_update_preview.call_count, 'Update preview should not have been called')
|
||||
mocked_preview_widget.change_slide.assert_called_once_with(7)
|
||||
mocked_slide_selected.assert_called_once_with()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user