def test_build_footer_invalid(self): """ Test the build_footer_css() function """ # GIVEN: Create a theme. css = [] item = MagicMock() item.theme_data = None item.footer = 'FAIL' height = 1024 # WHEN: Settings say that footer should wrap css.append(build_footer_css(item, height)) item.theme_data = 'TEST' item.footer = None css.append(build_footer_css(item, height)) # THEN: Footer should wrap self.assertEqual(FOOTER_CSS_INVALID, css[0], 'The footer strings should be blank.') self.assertEqual(FOOTER_CSS_INVALID, css[1], 'The footer strings should be blank.')
def build_footer_css_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: create the css with default settings. css = build_footer_css(item, height) # THEN: THE css should be the same. self.assertEqual(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 Settings().setValue('themes/wrap footer', True) css = build_footer_css(item, height) # THEN: Footer should wrap self.assertEqual(FOOTER_CSS_WRAP, css, 'The footer strings should be equal.')