예제 #1
0
 def test_parse(self):
     title = 'Cheese shoppe'
     author = 'King Arthur'
     content = 'this is teh content.\n and so is this.'
     text = """title: {}\nauthor: {}\n{}""".format(title, author, content)
     b = parse(text)
     self.assertEqual(title, b.title)
     self.assertEqual(author, b.author)
     self.assertEqual(content, b.markdown.strip())
예제 #2
0
 def test_parse(self):
     title = "Cheese shoppe"
     author = "King Arthur"
     content = "this is teh content.\n and so is this."
     text = """title: {}\nauthor: {}\n{}""".format(title, author, content)
     b = parse(text)
     self.assertEqual(title, b.title)
     self.assertEqual(author, b.author)
     self.assertEqual(content, b.markdown.strip())
예제 #3
0
    def test_complex_parse(self):
        title = 'Cheese shoppe'
        author = 'King Arthur'
        content = """
        This is some cool: colon seperated: content.
        and even a...
        fake-tag: with a value
        <heres>even</some>fake html
        this is teh content.\n and so is this.
        """
        text = """
        title: {}
        author: {}

        {}""".format(title, author, content)
        b = parse(text)
        self.assertEqual(title, b.title)
        self.assertEqual(author, b.author)
        self.assertEqual(content.strip(), b.markdown.strip())
예제 #4
0
    def test_complex_parse(self):
        title = "Cheese shoppe"
        author = "King Arthur"
        content = """
        This is some cool: colon seperated: content.
        and even a...
        fake-tag: with a value
        <heres>even</some>fake html
        this is teh content.\n and so is this.
        """
        text = """
        title: {}
        author: {}

        {}""".format(
            title, author, content
        )
        b = parse(text)
        self.assertEqual(title, b.title)
        self.assertEqual(author, b.author)
        self.assertEqual(content.strip(), b.markdown.strip())