Пример #1
0
    def test_malformed_section(self):
        text = """title: test

===section===
===notsection===
    """
        with self.assertRaises(ValueError):
            utils.parse(text)
Пример #2
0
    def test_malformed_section(self):
        text = """title: test

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