From caeb3d3ff79c6a131e2a337fd599dac52f264413 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 1 Jun 2016 23:42:54 +0200 Subject: [PATCH] Found the other tests, Mom! --- .../openlp_core_ui/test_servicemanager.py | 10 +++++----- .../openlp_core_ui/test_slidecontroller.py | 8 ++++---- .../test_listpreviewwidget.py | 20 +++++++++---------- .../openlp_plugins/songs/test_opsproimport.py | 2 +- .../openlp_core_ui/test_settings_form.py | 6 +++--- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/functional/openlp_core_ui/test_servicemanager.py b/tests/functional/openlp_core_ui/test_servicemanager.py index 3c6c20ab5..7882d8a24 100644 --- a/tests/functional/openlp_core_ui/test_servicemanager.py +++ b/tests/functional/openlp_core_ui/test_servicemanager.py @@ -544,7 +544,7 @@ class TestServiceManager(TestCase): @patch(u'openlp.core.ui.servicemanager.Settings') @patch(u'PyQt5.QtCore.QTimer.singleShot') - def single_click_preview_test_true(self, mocked_singleShot, MockedSettings): + def test_single_click_preview_true(self, mocked_singleShot, MockedSettings): """ Test that when "Preview items when clicked in Service Manager" enabled the preview timer starts """ @@ -561,7 +561,7 @@ class TestServiceManager(TestCase): @patch(u'openlp.core.ui.servicemanager.Settings') @patch(u'PyQt5.QtCore.QTimer.singleShot') - def single_click_preview_test_false(self, mocked_singleShot, MockedSettings): + def test_single_click_preview_false(self, mocked_singleShot, MockedSettings): """ Test that when "Preview items when clicked in Service Manager" disabled the preview timer doesn't start """ @@ -578,7 +578,7 @@ class TestServiceManager(TestCase): @patch(u'openlp.core.ui.servicemanager.Settings') @patch(u'PyQt5.QtCore.QTimer.singleShot') @patch(u'openlp.core.ui.servicemanager.ServiceManager.make_live') - def single_click_preview_test_double(self, mocked_make_live, mocked_singleShot, MockedSettings): + def test_single_click_preview_double(self, mocked_make_live, mocked_singleShot, MockedSettings): """ Test that when a double click has registered the preview timer doesn't start """ @@ -594,7 +594,7 @@ class TestServiceManager(TestCase): self.assertEquals(mocked_singleShot.call_count, 0, 'Should not be called') @patch(u'openlp.core.ui.servicemanager.ServiceManager.make_preview') - def single_click_timeout_test_single(self, mocked_make_preview): + def test_single_click_timeout_single(self, mocked_make_preview): """ Test that when a single click has been registered, the item is sent to preview """ @@ -607,7 +607,7 @@ class TestServiceManager(TestCase): @patch(u'openlp.core.ui.servicemanager.ServiceManager.make_preview') @patch(u'openlp.core.ui.servicemanager.ServiceManager.make_live') - def single_click_timeout_test_double(self, mocked_make_live, mocked_make_preview): + def test_single_click_timeout_double(self, mocked_make_live, mocked_make_preview): """ Test that when a double click has been registered, the item does not goes to preview """ diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 3777d5f82..126e67d1f 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -715,7 +715,7 @@ class TestSlideController(TestCase): @patch(u'openlp.core.ui.slidecontroller.SlideController.image_manager') @patch(u'PyQt5.QtCore.QTimer.singleShot') - def update_preview_test_live(self, mocked_singleShot, mocked_image_manager): + def test_update_preview_live(self, mocked_singleShot, mocked_image_manager): """ Test that the preview screen is updated with a screen grab for live service items """ @@ -758,7 +758,7 @@ class TestSlideController(TestCase): @patch(u'openlp.core.ui.slidecontroller.SlideController.image_manager') @patch(u'PyQt5.QtCore.QTimer.singleShot') - def update_preview_test_pres(self, mocked_singleShot, mocked_image_manager): + def test_update_preview_pres(self, mocked_singleShot, mocked_image_manager): """ Test that the preview screen is updated with the correct preview for presentation service items """ @@ -800,7 +800,7 @@ class TestSlideController(TestCase): @patch(u'openlp.core.ui.slidecontroller.SlideController.image_manager') @patch(u'PyQt5.QtCore.QTimer.singleShot') - def update_preview_test_media(self, mocked_singleShot, mocked_image_manager): + def test_update_preview_media(self, mocked_singleShot, mocked_image_manager): """ Test that the preview screen is updated with the correct preview for media service items """ @@ -842,7 +842,7 @@ class TestSlideController(TestCase): @patch(u'openlp.core.ui.slidecontroller.SlideController.image_manager') @patch(u'PyQt5.QtCore.QTimer.singleShot') - def update_preview_test_image(self, mocked_singleShot, mocked_image_manager): + def test_update_preview_image(self, mocked_singleShot, mocked_image_manager): """ Test that the preview screen is updated with the correct preview for image service items """ diff --git a/tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py b/tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py index 9ccd56a32..45c68219b 100644 --- a/tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py +++ b/tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py @@ -77,7 +77,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.image_manager') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') - def replace_service_item_test_thumbs(self, mocked_setRowHeight, mocked_resizeRowsToContents, + def test_replace_service_item_thumbs(self, mocked_setRowHeight, mocked_resizeRowsToContents, mocked_image_manager): """ Test that thubmails for different slides are loaded properly in replace_service_item. @@ -123,7 +123,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') - def replace_recalculate_layout_test_text(self, mocked_setRowHeight, mocked_resizeRowsToContents): + def test_replace_recalculate_layout_text(self, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, txt slides unchanged in replace_service_item & __recalc... """ @@ -155,7 +155,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') - def replace_recalculate_layout_test_img(self, mocked_setRowHeight, mocked_resizeRowsToContents): + def test_replace_recalculate_layout_img(self, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." disabled, img slides unchanged in replace_service_item & __recalc... """ @@ -192,7 +192,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') - def replace_recalculate_layout_test_img_max(self, mocked_setRowHeight, mocked_resizeRowsToContents): + def test_replace_recalculate_layout_img_max(self, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, img slides resized in replace_service_item & __recalc... """ @@ -228,7 +228,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') - def row_resized_test_text(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): + def test_row_resized_text(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, text-based slides not affected in row_resized. """ @@ -262,7 +262,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') - def row_resized_test_img(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): + def test_row_resized_img(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." disabled, image-based slides not affected in row_resized. """ @@ -299,7 +299,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') - def row_resized_test_img_max(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): + def test_row_resized_img_max(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, image-based slides are scaled in row_resized. """ @@ -335,7 +335,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') - def autoscroll_test_setting_invalid(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): + def test_autoscroll_setting_invalid(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): """ Test if 'advanced/autoscrolling' setting None or invalid, that no autoscrolling occurs on change_slide(). """ @@ -371,7 +371,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') - def autoscroll_test_dist_bounds(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): + def test_autoscroll_dist_bounds(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): """ Test if 'advanced/autoscrolling' setting asks to scroll beyond list bounds, that it does not beyond. """ @@ -401,7 +401,7 @@ class TestListPreviewWidget(TestCase): @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') - def autoscroll_test_normal(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): + def test_autoscroll_normal(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): """ Test if 'advanced/autoscrolling' setting valid, autoscrolling called as expected. """ diff --git a/tests/functional/openlp_plugins/songs/test_opsproimport.py b/tests/functional/openlp_plugins/songs/test_opsproimport.py index ad4afee0e..37174baa2 100644 --- a/tests/functional/openlp_plugins/songs/test_opsproimport.py +++ b/tests/functional/openlp_plugins/songs/test_opsproimport.py @@ -148,7 +148,7 @@ class TestOpsProSongImport(TestCase): return data[key] return '' - def _build_test_data(self, test_file, dual_language): + def test__build_data(self, test_file, dual_language): song = MagicMock() song.ID = 100 song.SongNumber = 123 diff --git a/tests/interfaces/openlp_core_ui/test_settings_form.py b/tests/interfaces/openlp_core_ui/test_settings_form.py index 9c95ac6f6..0d334f24f 100644 --- a/tests/interfaces/openlp_core_ui/test_settings_form.py +++ b/tests/interfaces/openlp_core_ui/test_settings_form.py @@ -134,7 +134,7 @@ class TestSettingsForm(TestCase, TestMixin): # THEN the processing stack should still have two items assert len(self.form.processes) == 2, 'No new processes should have been added to the stack' - def register_image_manager_trigger_test_one(self): + def test_register_image_manager_trigger_one(self): """ Test the triggering of the image manager rebuild event from image background change """ @@ -152,7 +152,7 @@ class TestSettingsForm(TestCase, TestMixin): assert self.dummy2.call_count == 0, 'dummy2 should not have been called at all' assert self.dummy3.call_count == 1, 'dummy3 should have been called once' - def register_image_manager_trigger_test_two(self): + def test_register_image_manager_trigger_two(self): """ Test the triggering of the image manager rebuild event from screen dimension change """ @@ -170,7 +170,7 @@ class TestSettingsForm(TestCase, TestMixin): assert self.dummy2.call_count == 1, 'dummy2 should have been called once' assert self.dummy3.call_count == 1, 'dummy3 should have been called once' - def register_image_manager_trigger_test_three(self): + def test_register_image_manager_trigger_three(self): """ Test the triggering of the image manager rebuild event from image background change and a change to the screen dimension.