def test_no_toc_generation_metadata(self): article_without_headers_path = "test_data/article_with_headers_metadata.md" article_without_headers = self._handle_article_generation( article_without_headers_path) toc.generate_toc(article_without_headers) with self.assertRaises(AttributeError): self.assertIsNone(article_without_headers.toc)
def _generate_toc(self, article_path, expected_path): result = self._handle_article_generation(article_path) toc.generate_toc(result) expected = "" with open(expected_path, 'r') as f: expected = f.read() return result, expected