Esempio n. 1
0
    def test_malformed_section(self):
        text = """title: test

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

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