Example #1
0
    def test_header_line_not_added_when_subject_not_given(self):
        html_page = MagicMock()
        qc_config = self.get_config_stub()

        html.add_page_header(html_page, qc_config, self.page_subject)

        for call in html_page.write.call_args_list:
            assert '<h1>' not in call[0]
Example #2
0
    def test_page_subject_set_as_title_when_none_given(self):
        html_page = MagicMock()
        qc_config = self.get_config_stub()

        html.add_page_header(html_page, qc_config, self.page_subject)

        for call in html_page.write.call_args_list:
            if '<TITLE>' in call[0]:
                assert self.page_subject in call[0]
Example #3
0
    def test_title_used_when_given(self):
        html_page = MagicMock()
        qc_config = self.get_config_stub()
        title = 'THIS IS MY TITLE'

        html.add_page_header(html_page,
                             qc_config,
                             self.page_subject,
                             title=title)

        for call in html_page.write.call_args_list:
            if '<TITLE>' in call[0]:
                assert title in call[0]
                assert self.page_subject not in call[0]