diff --git a/tests/docx/numbering_xml_tests.py b/tests/docx/numbering_xml_tests.py index b6959a67..1fb4c63d 100644 --- a/tests/docx/numbering_xml_tests.py +++ b/tests/docx/numbering_xml_tests.py @@ -34,11 +34,27 @@ def test_list_is_not_ordered_if_formatted_as_bullet(): numbering = _read_numbering_xml_element(_sample_numbering_xml) assert_equal(False, numbering.find_level("47", "0").is_ordered) + def test_list_is_ordered_if_formatted_as_decimal(): numbering = _read_numbering_xml_element(_sample_numbering_xml) assert_equal(True, numbering.find_level("47", "1").is_ordered) +def test_list_is_ordered_if_there_is_no_explicit_format(): + element = xml_element("w:numbering", {}, [ + xml_element("w:abstractNum", {"w:abstractNumId": "42"}, [ + xml_element("w:lvl", {"w:ilvl": "0"}), + ]), + xml_element("w:num", {"w:numId": "47"}, [ + xml_element("w:abstractNumId", {"w:val": "42"}) + ]) + ]) + + numbering = _read_numbering_xml_element(element) + + assert_equal(True, numbering.find_level("47", "0").is_ordered) + + def test_find_level_returns_none_if_level_cannot_be_found(): numbering = _read_numbering_xml_element(_sample_numbering_xml) assert_equal(None, numbering.find_level("47", "2"))