Found the other tests, Mom!

This commit is contained in:
Raoul Snyman 2016-06-01 23:42:54 +02:00
parent 672b8334fa
commit caeb3d3ff7
5 changed files with 23 additions and 23 deletions

View File

@ -544,7 +544,7 @@ class TestServiceManager(TestCase):
@patch(u'openlp.core.ui.servicemanager.Settings') @patch(u'openlp.core.ui.servicemanager.Settings')
@patch(u'PyQt5.QtCore.QTimer.singleShot') @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 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'openlp.core.ui.servicemanager.Settings')
@patch(u'PyQt5.QtCore.QTimer.singleShot') @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 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'openlp.core.ui.servicemanager.Settings')
@patch(u'PyQt5.QtCore.QTimer.singleShot') @patch(u'PyQt5.QtCore.QTimer.singleShot')
@patch(u'openlp.core.ui.servicemanager.ServiceManager.make_live') @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 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') self.assertEquals(mocked_singleShot.call_count, 0, 'Should not be called')
@patch(u'openlp.core.ui.servicemanager.ServiceManager.make_preview') @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 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_preview')
@patch(u'openlp.core.ui.servicemanager.ServiceManager.make_live') @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 Test that when a double click has been registered, the item does not goes to preview
""" """

View File

@ -715,7 +715,7 @@ class TestSlideController(TestCase):
@patch(u'openlp.core.ui.slidecontroller.SlideController.image_manager') @patch(u'openlp.core.ui.slidecontroller.SlideController.image_manager')
@patch(u'PyQt5.QtCore.QTimer.singleShot') @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 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'openlp.core.ui.slidecontroller.SlideController.image_manager')
@patch(u'PyQt5.QtCore.QTimer.singleShot') @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 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'openlp.core.ui.slidecontroller.SlideController.image_manager')
@patch(u'PyQt5.QtCore.QTimer.singleShot') @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 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'openlp.core.ui.slidecontroller.SlideController.image_manager')
@patch(u'PyQt5.QtCore.QTimer.singleShot') @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 Test that the preview screen is updated with the correct preview for image service items
""" """

View File

@ -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.image_manager')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') @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.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): mocked_image_manager):
""" """
Test that thubmails for different slides are loaded properly in replace_service_item. 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.resizeRowsToContents')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @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... 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.resizeRowsToContents')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @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... 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.resizeRowsToContents')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @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... 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.resizeRowsToContents')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') @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. 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.resizeRowsToContents')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') @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. 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.resizeRowsToContents')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') @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. 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.scrollToItem')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') @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(). 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.scrollToItem')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') @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. 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.scrollToItem')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item')
@patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') @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. Test if 'advanced/autoscrolling' setting valid, autoscrolling called as expected.
""" """

View File

@ -148,7 +148,7 @@ class TestOpsProSongImport(TestCase):
return data[key] return data[key]
return '' return ''
def _build_test_data(self, test_file, dual_language): def test__build_data(self, test_file, dual_language):
song = MagicMock() song = MagicMock()
song.ID = 100 song.ID = 100
song.SongNumber = 123 song.SongNumber = 123

View File

@ -134,7 +134,7 @@ class TestSettingsForm(TestCase, TestMixin):
# THEN the processing stack should still have two items # 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' 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 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.dummy2.call_count == 0, 'dummy2 should not have been called at all'
assert self.dummy3.call_count == 1, 'dummy3 should have been called once' 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 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.dummy2.call_count == 1, 'dummy2 should have been called once'
assert self.dummy3.call_count == 1, 'dummy3 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 Test the triggering of the image manager rebuild event from image background change and a change to the
screen dimension. screen dimension.