def numbering_properties_are_ignored_if_num_id_is_missing(self):
        paragraph_xml = self._paragraph_with_numbering_properties([xml_element("w:ilvl", {"w:val": "1"})])

        numbering = Numbering({"42": {"1": documents.numbering_level("1", True)}})
        paragraph = _read_and_get_document_xml_element(paragraph_xml, numbering=numbering)

        assert_equal(None, paragraph.numbering)
def bulleted_paragraphs_are_converted_using_matching_styles():
    result = convert_document_element_to_html(
        documents.paragraph(
            children=[_run_with_text("Hello")], numbering=documents.numbering_level(level_index=0, is_ordered=False)
        ),
        style_map=[style_reader.read_style("p:unordered-list(1) => ul > li:fresh")],
    )
    assert_equal("<ul><li>Hello</li></ul>", result.value)
    def paragraph_has_numbering_properties_from_paragraph_properties_if_present(self):
        paragraph_xml = self._paragraph_with_numbering_properties(
            [xml_element("w:ilvl", {"w:val": "1"}), xml_element("w:numId", {"w:val": "42"})]
        )

        numbering = Numbering({"42": {"1": documents.numbering_level("1", True)}})
        paragraph = _read_and_get_document_xml_element(paragraph_xml, numbering=numbering)

        assert_equal("1", paragraph.numbering.level_index)
        assert_equal(True, paragraph.numbering.is_ordered)
 def reads_paragraph_unordered_list(self):
     assert_equal(
         document_matchers.paragraph(numbering=documents.numbering_level(1, is_ordered=False)),
         read_document_matcher("p:unordered-list(2)")
     )
 def reads_paragraph_ordered_list_with_num_fmt(self):
     assert_equal(
         document_matchers.paragraph(numbering=documents.numbering_level(0, is_ordered=True, num_fmt='decimal')),
         read_document_matcher("p:ordered-list(1,decimal)")
     )