1
0
Fork 0
forked from github/pelican

Added unit test to test the markdown file extension.

This commit is contained in:
Michael Reneer 2012-12-10 23:32:35 -05:00 committed by Bruno Binet
commit 56a276d92e
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,10 @@
title: Test markdown File
category: test
Test Markdown File Header
=========================
Used for pelican test
---------------------
This is another markdown test file. Uses the markdown extension.

View file

@ -143,6 +143,17 @@ class MdReaderTest(unittest.TestCase):
self.assertEqual(content, expected)
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
def test_article_with_mkd_extension(self):
# test to ensure the markdown extension is being processed by the correct reader
reader = readers.MarkdownReader({})
content, metadata = reader.read(_filename('article_with_markdown_extension.markdown'))
expected = "<h1>Test Markdown File Header</h1>\n"\
"<h2>Used for pelican test</h2>\n"\
"<p>This is another markdown test file. Uses the markdown extension.</p>"
self.assertEqual(content, expected)
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
def test_article_with_markdown_markup_extension(self):
# test to ensure the markdown markup extension is being processed as expected