forked from openlp/openlp
Tidy up tests and formatting
This commit is contained in:
parent
9a1ce000b7
commit
668864c38d
@ -13,7 +13,6 @@ from openlp.core.lib.theme import HorizontalType, VerticalType
|
|||||||
from tests.functional import MagicMock, patch
|
from tests.functional import MagicMock, patch
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
HTML = """
|
HTML = """
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@ -216,7 +215,6 @@ class Htmbuilder(TestCase, TestMixin):
|
|||||||
"""
|
"""
|
||||||
self.destroy_settings()
|
self.destroy_settings()
|
||||||
|
|
||||||
|
|
||||||
def build_html_test(self):
|
def build_html_test(self):
|
||||||
"""
|
"""
|
||||||
Test the build_html() function
|
Test the build_html() function
|
||||||
@ -342,6 +340,18 @@ class Htmbuilder(TestCase, TestMixin):
|
|||||||
# THEN: THE css should be the same.
|
# THEN: THE css should be the same.
|
||||||
assert FOOTER_CSS == css, 'The footer strings should be equal.'
|
assert FOOTER_CSS == css, 'The footer strings should be equal.'
|
||||||
|
|
||||||
|
def build_footer_css_wrap_test(self):
|
||||||
|
"""
|
||||||
|
Test the build_footer_css() function
|
||||||
|
"""
|
||||||
|
# GIVEN: Create a theme.
|
||||||
|
item = MagicMock()
|
||||||
|
item.footer = QtCore.QRect(10, 921, 1260, 103)
|
||||||
|
item.theme_data.font_footer_name = 'Arial'
|
||||||
|
item.theme_data.font_footer_size = 12
|
||||||
|
item.theme_data.font_footer_color = '#FFFFFF'
|
||||||
|
height = 1024
|
||||||
|
|
||||||
# WHEN: Settings say that footer should wrap
|
# WHEN: Settings say that footer should wrap
|
||||||
Settings().setValue('themes/wrap footer', True)
|
Settings().setValue('themes/wrap footer', True)
|
||||||
css = build_footer_css(item, height)
|
css = build_footer_css(item, height)
|
||||||
|
@ -504,7 +504,6 @@ class TestSlideController(TestCase):
|
|||||||
mocked_item = MagicMock()
|
mocked_item = MagicMock()
|
||||||
mocked_item.is_command.return_value = True
|
mocked_item.is_command.return_value = True
|
||||||
mocked_item.name = 'Mocked Item'
|
mocked_item.name = 'Mocked Item'
|
||||||
mocked_execute = MagicMock()
|
|
||||||
mocked_update_preview = MagicMock()
|
mocked_update_preview = MagicMock()
|
||||||
mocked_preview_widget = MagicMock()
|
mocked_preview_widget = MagicMock()
|
||||||
mocked_slide_selected = MagicMock()
|
mocked_slide_selected = MagicMock()
|
||||||
@ -535,7 +534,6 @@ class TestSlideController(TestCase):
|
|||||||
mocked_item = MagicMock()
|
mocked_item = MagicMock()
|
||||||
mocked_item.is_command.return_value = False
|
mocked_item.is_command.return_value = False
|
||||||
mocked_item.name = 'Mocked Item'
|
mocked_item.name = 'Mocked Item'
|
||||||
mocked_execute = MagicMock()
|
|
||||||
mocked_update_preview = MagicMock()
|
mocked_update_preview = MagicMock()
|
||||||
mocked_preview_widget = MagicMock()
|
mocked_preview_widget = MagicMock()
|
||||||
mocked_slide_selected = MagicMock()
|
mocked_slide_selected = MagicMock()
|
||||||
@ -556,5 +554,3 @@ class TestSlideController(TestCase):
|
|||||||
self.assertEqual(0, mocked_update_preview.call_count, 'Update preview should not have been called')
|
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_preview_widget.change_slide.assert_called_once_with(7)
|
||||||
mocked_slide_selected.assert_called_once_with()
|
mocked_slide_selected.assert_called_once_with()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user