forked from openlp/openlp
Change the indentation back to 4
This commit is contained in:
parent
1347ad61d1
commit
316f33c058
@ -311,7 +311,7 @@ class TestLib(TestCase):
|
||||
mocked_image.save.assert_called_with(mocked_buffer, "PNG")
|
||||
mocked_byte_array.toBase64.assert_called_with()
|
||||
self.assertEqual('base64mock', result,
|
||||
'The result should be the return value of the mocked out base64 method')
|
||||
'The result should be the return value of the mocked out base64 method')
|
||||
|
||||
def create_thumb_with_size_test(self):
|
||||
"""
|
||||
|
@ -70,7 +70,7 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The create_media_manager_item() method should have been called
|
||||
self.assertEqual(0, mocked_plugin.create_media_manager_item.call_count,
|
||||
'The create_media_manager_item() method should not have been called.')
|
||||
'The create_media_manager_item() method should not have been called.')
|
||||
|
||||
def hook_media_manager_with_active_plugin_test(self):
|
||||
"""
|
||||
@ -103,7 +103,7 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The hook_settings_tabs() method should have been called
|
||||
self.assertEqual(0, mocked_plugin.create_media_manager_item.call_count,
|
||||
'The create_media_manager_item() method should not have been called.')
|
||||
'The create_media_manager_item() method should not have been called.')
|
||||
|
||||
def hook_settings_tabs_with_disabled_plugin_and_mocked_form_test(self):
|
||||
"""
|
||||
@ -123,9 +123,9 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The create_settings_tab() method should not have been called, but the plugins lists should be the same
|
||||
self.assertEqual(0, mocked_plugin.create_settings_tab.call_count,
|
||||
'The create_media_manager_item() method should not have been called.')
|
||||
'The create_media_manager_item() method should not have been called.')
|
||||
self.assertEqual(mocked_settings_form.plugin_manager.plugins, plugin_manager.plugins,
|
||||
'The plugins on the settings form should be the same as the plugins in the plugin manager')
|
||||
'The plugins on the settings form should be the same as the plugins in the plugin manager')
|
||||
|
||||
def hook_settings_tabs_with_active_plugin_and_mocked_form_test(self):
|
||||
"""
|
||||
@ -145,9 +145,9 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The create_media_manager_item() method should have been called with the mocked settings form
|
||||
self.assertEqual(1, mocked_plugin.create_settings_tab.call_count,
|
||||
'The create_media_manager_item() method should have been called once.')
|
||||
'The create_media_manager_item() method should have been called once.')
|
||||
self.assertEqual(plugin_manager.plugins, mocked_settings_form.plugin_manager.plugins,
|
||||
'The plugins on the settings form should be the same as the plugins in the plugin manager')
|
||||
'The plugins on the settings form should be the same as the plugins in the plugin manager')
|
||||
|
||||
def hook_settings_tabs_with_active_plugin_and_no_form_test(self):
|
||||
"""
|
||||
@ -180,7 +180,7 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The create_media_manager_item() method should have been called
|
||||
self.assertEqual(0, mocked_plugin.add_import_menu_item.call_count,
|
||||
'The add_import_menu_item() method should not have been called.')
|
||||
'The add_import_menu_item() method should not have been called.')
|
||||
|
||||
def hook_import_menu_with_active_plugin_test(self):
|
||||
"""
|
||||
@ -213,7 +213,7 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The add_export_menu_Item() method should not have been called
|
||||
self.assertEqual(0, mocked_plugin.add_export_menu_Item.call_count,
|
||||
'The add_export_menu_Item() method should not have been called.')
|
||||
'The add_export_menu_Item() method should not have been called.')
|
||||
|
||||
def hook_export_menu_with_active_plugin_test(self):
|
||||
"""
|
||||
@ -247,7 +247,7 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The upgrade_settings() method should not have been called
|
||||
self.assertEqual(0, mocked_plugin.upgrade_settings.call_count,
|
||||
'The upgrade_settings() method should not have been called.')
|
||||
'The upgrade_settings() method should not have been called.')
|
||||
|
||||
def hook_upgrade_plugin_settings_with_active_plugin_test(self):
|
||||
"""
|
||||
@ -281,7 +281,7 @@ class TestPluginManager(TestCase):
|
||||
|
||||
# THEN: The add_tools_menu_item() method should have been called
|
||||
self.assertEqual(0, mocked_plugin.add_tools_menu_item.call_count,
|
||||
'The add_tools_menu_item() method should not have been called.')
|
||||
'The add_tools_menu_item() method should not have been called.')
|
||||
|
||||
def hook_tools_menu_with_active_plugin_test(self):
|
||||
"""
|
||||
@ -420,7 +420,7 @@ class TestPluginManager(TestCase):
|
||||
# THEN: The isActive() method should have been called, and initialise() method should NOT have been called
|
||||
mocked_plugin.is_active.assert_called_with()
|
||||
self.assertEqual(0, mocked_plugin.new_service_created.call_count,
|
||||
'The new_service_created() method should not have been called.')
|
||||
'The new_service_created() method should not have been called.')
|
||||
|
||||
def new_service_created_with_active_plugin_test(self):
|
||||
"""
|
||||
|
@ -59,14 +59,14 @@ class TestRegistry(TestCase):
|
||||
with self.assertRaises(KeyError) as context:
|
||||
Registry().register('test1', mock_1)
|
||||
self.assertEqual(context.exception.args[0], 'Duplicate service exception test1',
|
||||
'KeyError exception should have been thrown for duplicate service')
|
||||
'KeyError exception should have been thrown for duplicate service')
|
||||
|
||||
# WHEN I try to get back a non existent component
|
||||
# THEN I will get an exception
|
||||
with self.assertRaises(KeyError) as context:
|
||||
temp = Registry().get('test2')
|
||||
self.assertEqual(context.exception.args[0], 'Service test2 not found in list',
|
||||
'KeyError exception should have been thrown for missing service')
|
||||
'KeyError exception should have been thrown for missing service')
|
||||
|
||||
# WHEN I try to replace a component I should be allowed (testing only)
|
||||
Registry().remove('test1')
|
||||
@ -74,7 +74,7 @@ class TestRegistry(TestCase):
|
||||
with self.assertRaises(KeyError) as context:
|
||||
temp = Registry().get('test1')
|
||||
self.assertEqual(context.exception.args[0], 'Service test1 not found in list',
|
||||
'KeyError exception should have been thrown for deleted service')
|
||||
'KeyError exception should have been thrown for deleted service')
|
||||
|
||||
def registry_function_test(self):
|
||||
"""
|
||||
|
@ -83,4 +83,4 @@ class TestScreenList(TestCase):
|
||||
new_screen_count = len(self.screens.screen_list)
|
||||
self.assertEqual(old_screen_count + 1, new_screen_count, 'The new_screens list should be bigger')
|
||||
self.assertEqual(SCREEN, self.screens.screen_list.pop(),
|
||||
'The 2nd screen should be identical to the first screen')
|
||||
'The 2nd screen should be identical to the first screen')
|
||||
|
@ -123,24 +123,24 @@ class TestServiceItem(TestCase):
|
||||
# THEN: We should get back a valid service item
|
||||
self.assertTrue(service_item.is_valid, 'The new service item should be valid')
|
||||
self.assertEqual(test_file, service_item.get_rendered_frame(0),
|
||||
'The first frame should match the path to the image')
|
||||
'The first frame should match the path to the image')
|
||||
self.assertEqual(frame_array, service_item.get_frames()[0],
|
||||
'The return should match frame array1')
|
||||
'The return should match frame array1')
|
||||
self.assertEqual(test_file, service_item.get_frame_path(0),
|
||||
'The frame path should match the full path to the image')
|
||||
'The frame path should match the full path to the image')
|
||||
self.assertEqual(image_name, service_item.get_frame_title(0),
|
||||
'The frame title should match the image name')
|
||||
'The frame title should match the image name')
|
||||
self.assertEqual(image_name, service_item.get_display_title(),
|
||||
'The display title should match the first image name')
|
||||
'The display title should match the first image name')
|
||||
self.assertTrue(service_item.is_image(), 'This service item should be of an "image" type')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanMaintain),
|
||||
'This service item should be able to be Maintained')
|
||||
'This service item should be able to be Maintained')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanPreview),
|
||||
'This service item should be able to be be Previewed')
|
||||
'This service item should be able to be be Previewed')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanLoop),
|
||||
'This service item should be able to be run in a can be made to Loop')
|
||||
'This service item should be able to be run in a can be made to Loop')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanAppend),
|
||||
'This service item should be able to have new items added to it')
|
||||
'This service item should be able to have new items added to it')
|
||||
|
||||
def service_item_load_image_from_local_service_test(self):
|
||||
"""
|
||||
@ -176,27 +176,27 @@ class TestServiceItem(TestCase):
|
||||
self.assertTrue(service_item.is_valid, 'The first service item should be valid')
|
||||
self.assertTrue(service_item2.is_valid, 'The second service item should be valid')
|
||||
self.assertEqual(test_file1, service_item.get_rendered_frame(0),
|
||||
'The first frame should match the path to the image')
|
||||
'The first frame should match the path to the image')
|
||||
self.assertEqual(test_file2, service_item2.get_rendered_frame(0),
|
||||
'The Second frame should match the path to the image')
|
||||
'The Second frame should match the path to the image')
|
||||
self.assertEqual(frame_array1, service_item.get_frames()[0], 'The return should match the frame array1')
|
||||
self.assertEqual(frame_array2, service_item2.get_frames()[0], 'The return should match the frame array2')
|
||||
self.assertEqual(test_file1, service_item.get_frame_path(0),
|
||||
'The frame path should match the full path to the image')
|
||||
'The frame path should match the full path to the image')
|
||||
self.assertEqual(test_file2, service_item2.get_frame_path(0),
|
||||
'The frame path should match the full path to the image')
|
||||
'The frame path should match the full path to the image')
|
||||
self.assertEqual(image_name1, service_item.get_frame_title(0),
|
||||
'The 1st frame title should match the image name')
|
||||
'The 1st frame title should match the image name')
|
||||
self.assertEqual(image_name2, service_item2.get_frame_title(0),
|
||||
'The 2nd frame title should match the image name')
|
||||
'The 2nd frame title should match the image name')
|
||||
self.assertEqual(service_item.name, service_item.title.lower(),
|
||||
'The plugin name should match the display title, as there are > 1 Images')
|
||||
'The plugin name should match the display title, as there are > 1 Images')
|
||||
self.assertTrue(service_item.is_image(), 'This service item should be of an "image" type')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanMaintain),
|
||||
'This service item should be able to be Maintained')
|
||||
'This service item should be able to be Maintained')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanPreview),
|
||||
'This service item should be able to be be Previewed')
|
||||
'This service item should be able to be be Previewed')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanLoop),
|
||||
'This service item should be able to be run in a can be made to Loop')
|
||||
'This service item should be able to be run in a can be made to Loop')
|
||||
self.assertTrue(service_item.is_capable(ItemCapabilities.CanAppend),
|
||||
'This service item should be able to have new items added to it')
|
||||
'This service item should be able to have new items added to it')
|
||||
|
@ -134,7 +134,7 @@ class TestUtils(TestCase):
|
||||
|
||||
# THEN: A tuple should be returned.
|
||||
self.assertEqual(wanted_result, result,
|
||||
'A two-entry tuple with the directory and file name (empty) should have been returned.')
|
||||
'A two-entry tuple with the directory and file name (empty) should have been returned.')
|
||||
|
||||
def clean_filename_test(self):
|
||||
"""
|
||||
@ -167,7 +167,7 @@ class TestUtils(TestCase):
|
||||
|
||||
# THEN: We get a properly sorted list
|
||||
self.assertEqual(['Aushang', '\u00C4u\u00DFerung', 'Auszug'], sorted_list,
|
||||
'Strings should be sorted properly')
|
||||
'Strings should be sorted properly')
|
||||
|
||||
def get_locale_key_linux_test(self):
|
||||
"""
|
||||
@ -180,12 +180,13 @@ class TestUtils(TestCase):
|
||||
mocked_get_language.return_value = 'de'
|
||||
mocked_os.name = 'linux'
|
||||
unsorted_list = ['Auszug', 'Aushang', '\u00C4u\u00DFerung']
|
||||
|
||||
# WHEN: We sort the list and use get_locale_key() to generate the sorting keys
|
||||
sorted_list = sorted(unsorted_list, key=get_locale_key)
|
||||
|
||||
# THEN: We get a properly sorted list
|
||||
self.assertEqual(['Aushang', '\u00C4u\u00DFerung', 'Auszug'], sorted_list,
|
||||
'Strings should be sorted properly')
|
||||
'Strings should be sorted properly')
|
||||
|
||||
def get_natural_key_test(self):
|
||||
"""
|
||||
|
@ -82,7 +82,8 @@ class TestVerseReferenceList(TestCase):
|
||||
|
||||
# THEN: The current index should be 0 and the end pointer of the entry should be '2'
|
||||
self.assertEqual(reference_list.current_index, 0, 'The current index should be 0')
|
||||
self.assertEqual(reference_list.verse_list[0]['end'], next_verse, 'The end in first entry should be %u' % next_verse)
|
||||
self.assertEqual(reference_list.verse_list[0]['end'], next_verse,
|
||||
'The end in first entry should be %u' % next_verse)
|
||||
|
||||
def add_another_verse_test(self):
|
||||
"""
|
||||
@ -123,8 +124,8 @@ class TestVerseReferenceList(TestCase):
|
||||
# THEN: the data will be appended to the list
|
||||
self.assertEqual(len(reference_list.version_list), 1, 'The version data should be appended')
|
||||
self.assertEqual(reference_list.version_list[0],
|
||||
{'version': version, 'copyright': copyright_, 'permission': permission},
|
||||
'The version data should be appended')
|
||||
{'version': version, 'copyright': copyright_, 'permission': permission},
|
||||
'The version data should be appended')
|
||||
|
||||
def add_existing_version_test(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user