1import unittest
2from orangecanvas.utils import markup
3
4
5RST = """
6Title
7-----
8
9* aaa
10* bbb
11"""
12
13MD = """
14Title
15-----
16
17* aaa
18* bbb
19"""
20
21HTML = """<h3>Title</h3><p><ul><li>aaa</li><li>bbb</li></ul></p>"""
22
23
24# This does not really test much since most of it is in 3rd party
25# implementation. Just run through the calls
26class TestMarkup(unittest.TestCase):
27    def test_markup(self):
28        c = markup.render_as_rich_text(RST, "text/x-rst",)
29        self.assertIn("<", c)
30        c = markup.render_as_rich_text(MD, "text/markdown")
31        self.assertTrue(c.startswith("<"))
32        c = markup.render_as_rich_text(HTML, "text/html")
33        self.assertTrue(c.startswith("<"))
34        c = markup.render_as_rich_text(RST, "text/plain")
35        self.assertIn("<", c)
36