summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-03-20 18:58:00 +0000
committerMichael Williamson <mike@zwobble.org>2024-03-20 18:58:00 +0000
commit74d3543f6a7fa82d8f00cd8bdd6afc6763f7dfba (patch)
treea85fb59c8b710dda6b8aa7e37d76ed4f0ea8bf08
parent3930c760efe904da71aa2a52ff9ac4b30b3bd64b (diff)
Add test for format of numbering level without explicit format
-rw-r--r--tests/docx/numbering_xml_tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/docx/numbering_xml_tests.py b/tests/docx/numbering_xml_tests.py
index b6959a6..1fb4c63 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"))