Beispiel #1
0
 def test_create_items(self):
     list_ = UnorderedList()
     items = list_.create_items("foo", "bar", "baz")
     assert_equal([
         b"<ul>", b"<li>", b"foo", b"</li>", b"<li>", b"bar", b"</li>",
         b"<li>", b"baz", b"</li>", b"</ul>"
     ], list(iter(list_)))
     assert_equal(3, len(items))
Beispiel #2
0
 def test_create_items(self):
     list_ = UnorderedList()
     items = list_.create_items("foo", "bar", "baz")
     assert_equal([b"<ul>",
                   b"<li>", b"foo", b"</li>",
                   b"<li>", b"bar", b"</li>",
                   b"<li>", b"baz", b"</li>",
                   b"</ul>"],
                  list(iter(list_)))
     assert_equal(3, len(items))
Beispiel #3
0
 def test_create_item_with_content(self):
     list_ = UnorderedList()
     list_.create_item("Test Content")
     assert_equal([b"<ul>", b'<li>', b"Test Content", b"</li>", b"</ul>"],
                  list(iter(list_)))
Beispiel #4
0
 def test_create_item_no_content(self):
     list_ = UnorderedList()
     item = list_.create_item()
     item.add_css_classes("test-class")
     assert_equal([b"<ul>", b'<li class="test-class">', b"</li>", b"</ul>"],
                  list(iter(list_)))
Beispiel #5
0
def make_list(*items):
    ul = UnorderedList()
    ul.extend(items)
    return ul
Beispiel #6
0
 def test_create_item_with_content(self):
     list_ = UnorderedList()
     list_.create_item("Test Content")
     assert_equal([b"<ul>", b'<li>', b"Test Content", b"</li>", b"</ul>"],
                  list(iter(list_)))
Beispiel #7
0
 def test_create_item_no_content(self):
     list_ = UnorderedList()
     item = list_.create_item()
     item.add_css_classes("test-class")
     assert_equal([b"<ul>", b'<li class="test-class">', b"</li>", b"</ul>"],
                  list(iter(list_)))
Beispiel #8
0
 def test_empty(self):
     list_ = UnorderedList()
     assert_equal([b"<ul>", b"</ul>"], list(iter(list_)))