Added Test to HTML Builder

This commit is contained in:
Ian Knight 2016-04-26 12:13:17 +09:30
parent 61ffd29cad
commit fea43c46b9
1 changed files with 21 additions and 0 deletions

View File

@ -197,6 +197,7 @@ FOOTER_CSS_BASE = """
"""
FOOTER_CSS = FOOTER_CSS_BASE % ('nowrap')
FOOTER_CSS_WRAP = FOOTER_CSS_BASE % ('normal')
FOOTER_CSS_INVALID = ''
class Htmbuilder(TestCase, TestMixin):
@ -359,6 +360,26 @@ class Htmbuilder(TestCase, TestMixin):
# THEN: Footer should wrap
self.assertEqual(FOOTER_CSS_WRAP, css, 'The footer strings should be equal.')
def build_footer_invalid_test(self):
"""
Test the build_footer_css() function
"""
# GIVEN: Create a theme.
css = []
item = MagicMock()
item.theme_data = None
item.footer = 'FAIL'
# 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 webkit_version_test(self):
"""
Test the webkit_version() function