Skip to content

Commit

Permalink
correct list usage in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ikirudennis committed Nov 4, 2024
1 parent 39f2de5 commit 5f2a113
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ def test_lists():

def test_nested_list():
lst = List('ol', indent_level=1)
lst('li', 'test')
lst.add_item('li', 'test')
s = List('ol', indent_level=2)
s.add_item('li', 'another one')
lst('li', s)
result = lst()
lst.add_item('li', s)
result = lst.process()
expect = '\t<ol>\n\t\t<li>test\n\t\t<ol>\n\t\t\t<li>another one</li>\n\t\t</ol></li>\n\t</ol>'
assert result == expect

lst = List('ol', indent_level=1)
lst('li', 'test')
lst.add_item('li', 'test')
s1 = List('ol', indent_level=2)
s1.add_item('li', 'another one')
s2 = List('ul', indent_level=3)
s2.add_item('li', 'point one')
s2.add_item('li', 'point two')
s1.add_item('li', s2)
s1.add_item('li', 'moar item')
lst('li', s1)
result = lst()
lst.add_item('li', s1)
result = lst.process()
expect = '\t<ol>\n\t\t<li>test\n\t\t<ol>\n\t\t\t<li>another one\n\t\t\t<ul>\n\t\t\t\t<li>point one</li>\n\t\t\t\t<li>point two</li>\n\t\t\t</ul></li>\n\t\t\t<li>moar item</li>\n\t\t</ol></li>\n\t</ol>'
assert result == expect

Expand Down

0 comments on commit 5f2a113

Please sign in to comment.