Exemplo n.º 1
0
 def test_it(self):
     from statics.markdown import MarkdownItem
     f = self.createFile("some markdown document.")
     item = MarkdownItem("name", f.name)
     self.assertEqual(item.name, "name")
     self.assertEqual(item.metadata(), {})
     self.assertEqual(item.content(), "<p>some markdown document.</p>")
Exemplo n.º 2
0
 def test_with_metadate(self):
     from statics.markdown import MarkdownItem
     f = self.createFile("Title: A Title\nList: Value1\n\tValue2\n\ncontent")
     item = MarkdownItem("name", f.name)
     self.assertEqual(item.name, "name")
     self.assertEqual(item.metadata(), {"title": "A Title",
                                        "list": ["Value1", "Value2"]})
     self.assertEqual(item.content(), "<p>content</p>")