diff --git a/tests/fixtures/docs/page_with_meta.md b/tests/fixtures/docs/page_with_meta.md index 2e2545db..4fa8f3d8 100644 --- a/tests/fixtures/docs/page_with_meta.md +++ b/tests/fixtures/docs/page_with_meta.md @@ -1,5 +1,9 @@ --- -Title: Use the MkDocs RSS Plugin +title: Use the MkDocs RSS Plugin +authors: + - Guts + - Tim Vink + - liang2kl date: 2020-03-20 10:20 description: First test page of mkdocs-rss-plugin test suite tags: diff --git a/tests/test_build.py b/tests/test_build.py index 01623e00..5985d869 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -95,7 +95,7 @@ def test_simple_build_minimal(self): # created items feed_parsed = feedparser.parse(Path(tmpdirname) / "feed_rss_created.xml") for feed_item in feed_parsed.entries: - print(feed_item.keys()) + # mandatory properties self.assertTrue("description" in feed_item) self.assertTrue("guid" in feed_item) @@ -104,11 +104,13 @@ def test_simple_build_minimal(self): self.assertTrue("source" in feed_item) self.assertTrue("title" in feed_item) # optional - following should not be present in the feed by default - self.assertTrue("author" not in feed_item) self.assertTrue("category" not in feed_item) self.assertTrue("comments" not in feed_item) self.assertTrue("enclosure" not in feed_item) + if feed_item.title in ("Test page with meta",): + self.assertTrue("author" in feed_item) + def test_simple_build_disabled(self): with tempfile.TemporaryDirectory() as tmpdirname: cli_result = self.build_docs_setup(