-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
31 lines (24 loc) · 779 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest
from markdown import markdown
list_expected = '''<ul dir="auto">
<li>first item</li>
<li>second item</li>
</ul>'''
class AutoDirectionTestCase(unittest.TestCase):
def test_ok(self):
text = "Text"
html = markdown(text, extensions=['autodirection'])
self.assertEqual(
html,
'<p dir="auto">Text</p>'
)
def test_list(self):
text = '- first item\n- second item'
html = markdown(text, extensions=['autodirection'])
self.assertEqual(html, list_expected)
def test_header(self):
text = "# header"
html = markdown(text, extensions=['autodirection'])
self.assertEqual(html, '<h1 dir="auto">header</h1>')
if __name__ == '__main__':
unittest.main()