import unittest from markdown import parse_markdown # Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0 class TestMarkdown(unittest.TestCase): def test_paragraph(self): self.assertEqual(parse_markdown('This will be a paragraph'), '

This will be a paragraph

') def test_italics(self): self.assertEqual(parse_markdown('_This will be italic_'), '

This will be italic

') def test_bold(self): self.assertEqual(parse_markdown('__This will be bold__'), '

This will be bold

') def test_mixed(self): self.assertEqual(parse_markdown('This will _be_ __mixed__'), '

This will be mixed

') def test_h1(self): self.assertEqual(parse_markdown('# This will be an h1'), '

This will be an h1

') def test_h2(self): self.assertEqual(parse_markdown('## This will be an h2'), '

This will be an h2

') def test_h6(self): self.assertEqual(parse_markdown( '###### This will be an h6'), '
This will be an h6
') def test_unordered_lists(self): self.assertEqual(parse_markdown('* Item 1\n* Item 2'), '') def test_little_bit_of_everything(self): self.assertEqual(parse_markdown( '# Header!\n* __Bold Item__\n* _Italic Item_'), '

Header!

') if __name__ == '__main__': unittest.main()