diff --git a/tests/content/article_with_md_extension.md b/tests/content/article_with_md_extension.md index 11aa22a2..1f111796 100644 --- a/tests/content/article_with_md_extension.md +++ b/tests/content/article_with_md_extension.md @@ -1,5 +1,8 @@ -title: Test md File -category: test +Title: Test md File +Category: test +Tags: foo, bar, foobar +Date: 2010-12-02 10:14 +Summary: I have a lot to test Test Markdown File Header ========================= diff --git a/tests/test_readers.py b/tests/test_readers.py index 474b1b4b..f7cf71d9 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -115,43 +115,46 @@ class RstReaderTest(unittest.TestCase): class MdReaderTest(unittest.TestCase): @unittest.skipUnless(readers.Markdown, "markdown isn't installed") - def test_article_with_md_extension(self): - # test to ensure the md extension is being processed by the correct reader + def test_article_with_metadata(self): reader = readers.MarkdownReader({}) - content, metadata = reader.read(_path('article_with_md_extension.md')) - expected = "
The quick brown fox jumped over the lazy dog's back.
" - - self.assertEqual(content, expected) - + content, metadata = reader.read( + _path('article_with_md_extension.md')) expected = { 'category': 'test', 'title': 'Test md File', + 'summary': 'I have a lot to test
', + 'date': datetime.datetime(2010, 12, 2, 10, 14), + 'tags': ['foo', 'bar', 'foobar'], } for key, value in metadata.items(): self.assertEquals(value, expected[key], key) @unittest.skipUnless(readers.Markdown, "markdown isn't installed") - def test_article_with_mkd_extension(self): - # test to ensure the mkd extension is being processed by the correct reader + def test_article_with_file_extensions(self): reader = readers.MarkdownReader({}) - content, metadata = reader.read(_path('article_with_mkd_extension.mkd')) + # test to ensure the md file extension is being processed by the + # correct reader + content, metadata = reader.read( + _path('article_with_md_extension.md')) expected = "This is another markdown test file. Uses the mkd extension.
" - + "The quick brown fox jumped over the lazy dog's back.
" 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 = "This is another markdown test file. Uses the markdown extension.
" - + # test to ensure the mkd file extension is being processed by the + # correct reader + content, metadata = reader.read( + _path('article_with_mkd_extension.mkd')) + expected = "This is another markdown test file. Uses"\ + " the mkd extension.
" + self.assertEqual(content, expected) + # test to ensure the markdown file extension is being processed by the + # correct reader + content, metadata = reader.read( + _path('article_with_markdown_extension.markdown')) + expected = "This is another markdown test file. Uses"\ + " the markdown extension.
" self.assertEqual(content, expected) @unittest.skipUnless(readers.Markdown, "markdown isn't installed")