diff options
| author | Michael Williamson <mike@zwobble.org> | 2021-05-11 22:32:40 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2021-05-11 22:32:40 +0100 |
| commit | ed6b3a42bd63774fdf018d65989cb50c33fa2ee5 (patch) | |
| tree | 6fb975d253f1f2322b00612d732f8ed87b54c95d /tests | |
| parent | 74f321ec965d5bdfff5849aad174f2b78188f45c (diff) | |
Handle w:num with invalid w:abstractNumId
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/docx/numbering_xml_tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/docx/numbering_xml_tests.py b/tests/docx/numbering_xml_tests.py index 812610e..6c1d843 100644 --- a/tests/docx/numbering_xml_tests.py +++ b/tests/docx/numbering_xml_tests.py @@ -51,6 +51,19 @@ def find_level_returns_none_if_level_cannot_be_found(): @istest +def num_referencing_non_existent_abstract_num_is_ignored(): + element = xml_element("w:numbering", {}, [ + xml_element("w:num", {"w:numId": "47"}, [ + xml_element("w:abstractNumId", {"w:val": "42"}) + ]) + ]) + + numbering = _read_numbering_xml_element(element) + + assert_equal(None, numbering.find_level("47", "0")) + + +@istest def when_abstract_num_has_num_style_link_then_style_is_used_to_find_num(): numbering = _read_numbering_xml_element( xml_element("w:numbering", {}, [ |
