mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Updated unit tests to test markdown summary metadata.
This commit is contained in:
parent
733e41a6a7
commit
f66c16bd52
4 changed files with 28 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
Title: Article with markdown and summary metadata multi
|
||||
Date: 2012-10-31
|
||||
Summary:
|
||||
A multi-line summary should be supported
|
||||
as well as **inline markup**.
|
||||
|
||||
This is some content.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Title: Article with markdown and summary metadata single
|
||||
Date: 2012-10-30
|
||||
Summary: A single-line summary should be supported as well as **inline markup**.
|
||||
|
||||
This is some content.
|
||||
|
|
@ -71,6 +71,8 @@ class TestArticlesGenerator(unittest.TestCase):
|
|||
articles = self.distill_articles(generator.articles)
|
||||
articles_expected = [
|
||||
[u'Article title', 'published', 'Default', 'article'],
|
||||
[u'Article with markdown and summary metadata single', 'published', u'Default', 'article'],
|
||||
[u'Article with markdown and summary metadata multi', 'published', u'Default', 'article'],
|
||||
[u'Article with template', 'published', 'Default', 'custom'],
|
||||
[u'Test md File', 'published', 'test', 'article'],
|
||||
[u'Rst with filename metadata', 'published', u'yeah', 'article'],
|
||||
|
|
|
|||
|
|
@ -203,6 +203,20 @@ class MdReaderTest(unittest.TestCase):
|
|||
for key, value in expected.items():
|
||||
self.assertEquals(value, metadata[key], key)
|
||||
|
||||
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
|
||||
def test_article_with_summary_metadata(self):
|
||||
reader = readers.MarkdownReader({})
|
||||
content, metadata = reader.read(
|
||||
_filename('article_with_markdown_and_summary_metadata_single.md'))
|
||||
expected_summary = u'<p>A single-line summary should be supported'\
|
||||
u' as well as <strong>inline markup</strong>.</p>'
|
||||
self.assertEquals(expected_summary, metadata['summary'], 'summary')
|
||||
content, metadata = reader.read(
|
||||
_filename('article_with_markdown_and_summary_metadata_multi.md'))
|
||||
expected_summary = u'<p>A multi-line summary should be supported'\
|
||||
u'\nas well as <strong>inline markup</strong>.</p>'
|
||||
self.assertEquals(expected_summary, metadata['summary'], 'summary')
|
||||
|
||||
class AdReaderTest(unittest.TestCase):
|
||||
|
||||
@unittest.skipUnless(readers.asciidoc, "asciidoc isn't installed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue