forked from openlp/openlp
Fix a test that was failing (not sure why)
This commit is contained in:
parent
bc2fac7cfd
commit
7086c88c7c
|
@ -58,20 +58,21 @@ class TestThemeManager(TestCase, TestMixin):
|
||||||
Test the thememanager initialise - basic test
|
Test the thememanager initialise - basic test
|
||||||
"""
|
"""
|
||||||
# GIVEN: A new a call to initialise
|
# GIVEN: A new a call to initialise
|
||||||
|
self.theme_manager.setup_ui = MagicMock()
|
||||||
self.theme_manager.build_theme_path = MagicMock()
|
self.theme_manager.build_theme_path = MagicMock()
|
||||||
self.theme_manager.load_first_time_themes = MagicMock()
|
self.theme_manager.load_first_time_themes = MagicMock()
|
||||||
|
self.theme_manager.upgrade_themes = MagicMock()
|
||||||
Settings().setValue('themes/global theme', 'my_theme')
|
Settings().setValue('themes/global theme', 'my_theme')
|
||||||
|
|
||||||
# WHEN: the initialisation is run
|
# WHEN: the initialisation is run
|
||||||
self.theme_manager.bootstrap_initialise()
|
self.theme_manager.bootstrap_initialise()
|
||||||
|
|
||||||
# THEN:
|
# THEN:
|
||||||
self.assertEqual(1, self.theme_manager.build_theme_path.call_count,
|
self.theme_manager.setup_ui.assert_called_once_with(self.theme_manager)
|
||||||
'The function build_theme_path should have been called')
|
assert self.theme_manager.global_theme == 'my_theme'
|
||||||
self.assertEqual(1, self.theme_manager.load_first_time_themes.call_count,
|
self.theme_manager.build_theme_path.assert_called_once_with()
|
||||||
'The function load_first_time_themes should have been called only once')
|
self.theme_manager.load_first_time_themes.assert_called_once_with()
|
||||||
self.assertEqual(self.theme_manager.global_theme, 'my_theme',
|
self.theme_manager.upgrade_themes.assert_called_once_with()
|
||||||
'The global theme should have been set to my_theme')
|
|
||||||
|
|
||||||
@patch('openlp.core.ui.thememanager.create_paths')
|
@patch('openlp.core.ui.thememanager.create_paths')
|
||||||
@patch('openlp.core.ui.thememanager.AppLocation.get_section_data_path')
|
@patch('openlp.core.ui.thememanager.AppLocation.get_section_data_path')
|
||||||
|
|
Loading…
Reference in New Issue