def test_malformed_section(self): text = """title: test ===section=== ===notsection=== """ with self.assertRaises(ValueError): utils.parse(text)
def test_parse(self): text = """title: Homepage Homepage is great, isn't it? Markdown code block!!! > What about a quote?""" meta, content = utils.parse(text) self.assertTrue("title" in meta) self.assertEquals("Homepage", meta["title"]) self.assertTrue("main" in content)
def test_parse_meta_only(self): text = "title: test" meta, content = utils.parse(text) self.assertEquals({"title": u"test"}, meta) self.assertEquals({"main": u""}, content)
def test_parse_no_content(self): text = "" meta, content = utils.parse(text) self.assertEquals({}, meta) self.assertEquals({"main": u""}, content)