forked from github/pelican
Added unit test to test the markdown file extension.
This commit is contained in:
parent
ffdf8babbf
commit
56a276d92e
2 changed files with 21 additions and 0 deletions
10
tests/content/article_with_markdown_extension.markdown
Normal file
10
tests/content/article_with_markdown_extension.markdown
Normal 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.
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue