def test_render_calls_report_manager_add_methods(self, mock_paragraph): Configuration.report_text = 'tests/pyccata.core/data' config = DataProviders.get_paragraph_config_for_section() section = Section(self._thread_manager, config) self.assertEquals(4, len(section._structure)) for item in section._structure: self.assertIsInstance(item, Paragraph) section.render(ReportManager()) calls = [ call('This is paragraph number 1'), call('This is paragraph number 3'), call('This is paragraph number 4'), call('This is paragraph number 5') ] mock_paragraph.assert_has_calls(calls)
def test_parse_structure_returns_list_of_paragraphs(self): config = DataProviders.get_paragraph_config_for_section() section = Section(self._thread_manager, config) self.assertEquals(4, len(section._structure)) for item in section._structure: self.assertIsInstance(item, Paragraph)