# Path: htmlgen/list.py
# class OrderedList(_ListBase):
#     """An HTML ordered list (<ol>) element.
# 
#     It contains ListItem children.
# 
#         >>> list_ = OrderedList()
#         >>> item = list_.create_item("First Item")
#         >>> item.add_css_classes("first-item")
#         >>> list_.append(ListItem("Second Item"))
#     """
# 
#     def __init__(self):
#         super().__init__("ol")
# 
#     start = int_html_attribute("start", 1)
# 
# class UnorderedList(_ListBase):
#     """An HTML unordered list (<ul>) element.
# 
#     It contains ListItem children.
# 
#         >>> list_ = UnorderedList()
#         >>> item = list_.create_item("First Item")
#         >>> item.add_css_classes("first-item")
#         >>> list_.append(ListItem("Second Item"))
#     """
# 
#     def __init__(self):
#         super().__init__("ul")
# 
# class ListItem(Element):
#     """An HTML list item (<li>) element.
# 
#     These elements are used as children of OrderedList and UnorderedList.
#     """
# 
#     def __init__(self, *content):
#         super().__init__("li")
#         self.extend(content)
# 
# class DescriptionList(Element):
#     """An HTML description list (<dl>) element.
# 
#     This used to be known as a "definition list" and is a list of terms and
#     their descriptions.
# 
#         >>> dl = DescriptionList()
#         >>> term, definition = dl.create_item("Term", "Long description.")
#         >>> term.add_css_classes("my-term")
#         >>> str(dl)
#         '<dl><dt class="my-term">Term</dt><dd>Long description.</dd></dl>'
#     """
# 
#     def __init__(self):
#         super().__init__("dl")
# 
#     def create_item(self, term, description):
#         """Create term and definition elements and add them to the list.
# 
#         Returns a (term element, description element) tuple.
# 
#         """
#         dt = DescriptionTerm(term)
#         dd = DescriptionDefinition(description)
#         self.append(dt)
#         self.append(dd)
#         return dt, dd


from unittest import TestCase
from asserts import assert_equal
from htmlgen.list import OrderedList, UnorderedList, ListItem, DescriptionList
                b"bar",
                b"</li>",
                b"<li>",
                b"baz",
                b"</li>",
                b"</ol>",
            ],
            list(iter(list_)),
        )
        assert_equal(3, len(items))

    def test_start_attribute(self):
        list_ = OrderedList()
        list_.start = 7
        assert_equal(7, list_.start)
        assert_equal([b'<ol start="7">', b"</ol>"], list(iter(list_)))

    def test_start_attribute_default(self):
        list_ = OrderedList()
        assert_equal(1, list_.start)
        list_.start = 1
        assert_equal([b"<ol>", b"</ol>"], list(iter(list_)))


class UnorderedListTest(TestCase):
    def test_empty(self):
        list_ = UnorderedList()
        assert_equal([b"<ul>", b"</ul>"], list(iter(list_)))

    def test_create_item_no_content(self):

# Path: htmlgen/list.py
# class OrderedList(_ListBase):
#     """An HTML ordered list (<ol>) element.
# 
#     It contains ListItem children.
# 
#         >>> list_ = OrderedList()
#         >>> item = list_.create_item("First Item")
#         >>> item.add_css_classes("first-item")
#         >>> list_.append(ListItem("Second Item"))
#     """
# 
#     def __init__(self):
#         super().__init__("ol")
# 
#     start = int_html_attribute("start", 1)
# 
# class UnorderedList(_ListBase):
#     """An HTML unordered list (<ul>) element.
# 
#     It contains ListItem children.
# 
#         >>> list_ = UnorderedList()
#         >>> item = list_.create_item("First Item")
#         >>> item.add_css_classes("first-item")
#         >>> list_.append(ListItem("Second Item"))
#     """
# 
#     def __init__(self):
#         super().__init__("ul")
# 
# class ListItem(Element):
#     """An HTML list item (<li>) element.
# 
#     These elements are used as children of OrderedList and UnorderedList.
#     """
# 
#     def __init__(self, *content):
#         super().__init__("li")
#         self.extend(content)
# 
# class DescriptionList(Element):
#     """An HTML description list (<dl>) element.
# 
#     This used to be known as a "definition list" and is a list of terms and
#     their descriptions.
# 
#         >>> dl = DescriptionList()
#         >>> term, definition = dl.create_item("Term", "Long description.")
#         >>> term.add_css_classes("my-term")
#         >>> str(dl)
#         '<dl><dt class="my-term">Term</dt><dd>Long description.</dd></dl>'
#     """
# 
#     def __init__(self):
#         super().__init__("dl")
# 
#     def create_item(self, term, description):
#         """Create term and definition elements and add them to the list.
# 
#         Returns a (term element, description element) tuple.
# 
#         """
#         dt = DescriptionTerm(term)
#         dd = DescriptionDefinition(description)
#         self.append(dt)
#         self.append(dd)
#         return dt, dd


# Path: test_htmlgen/list.py
from unittest import TestCase
from asserts import assert_equal
from htmlgen.list import OrderedList, UnorderedList, ListItem, DescriptionList

                b"bar",
                b"</li>",
                b"<li>",
                b"baz",
                b"</li>",
                b"</ol>",
            ],
            list(iter(list_)),
        )
        assert_equal(3, len(items))

    def test_start_attribute(self):
        list_ = OrderedList()
        list_.start = 7
        assert_equal(7, list_.start)
        assert_equal([b'<ol start="7">', b"</ol>"], list(iter(list_)))

    def test_start_attribute_default(self):
        list_ = OrderedList()
        assert_equal(1, list_.start)
        list_.start = 1
        assert_equal([b"<ol>", b"</ol>"], list(iter(list_)))


class UnorderedListTest(TestCase):
    def test_empty(self):
        list_ = UnorderedList()
        assert_equal([b"<ul>", b"</ul>"], list(iter(list_)))

    def test_create_item_no_content(self):

        list_ = UnorderedList()