Example #1
0
    def test_malformed_section(self):
        text = """title: test

===section===
===notsection===
    """
        with self.assertRaises(ValueError):
            utils.parse(text)
Example #2
0
    def test_malformed_section(self):
        text = """title: test

===section===
===notsection===
    """
        with self.assertRaises(ValueError):
            utils.parse(text)
Example #3
0
    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)
Example #4
0
    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)
Example #5
0
 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)
Example #6
0
 def test_parse_no_content(self):
     text = ""
     meta, content = utils.parse(text)
     self.assertEquals({}, meta)
     self.assertEquals({"main": u""}, content)
Example #7
0
 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)
Example #8
0
 def test_parse_no_content(self):
     text = ""
     meta, content = utils.parse(text)
     self.assertEquals({}, meta)
     self.assertEquals({"main": u""}, content)