diff options
| author | Michael Williamson <mike@zwobble.org> | 2019-03-17 21:20:58 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2019-03-17 21:20:58 +0000 |
| commit | 65834fa39ee1ea77ef5581bc11e4e6046c6499a6 (patch) | |
| tree | 6fc2bd56ec9938fcfd9a0d02dc522cf8bd270925 /tests/docx | |
| parent | 2c01dcb90076ebaeee903302f7948a745b1abd87 (diff) | |
Pass styles into read_numbering_xml_element
Diffstat (limited to 'tests/docx')
| -rw-r--r-- | tests/docx/numbering_xml_tests.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/docx/numbering_xml_tests.py b/tests/docx/numbering_xml_tests.py index 8fb59ff..467d406 100644 --- a/tests/docx/numbering_xml_tests.py +++ b/tests/docx/numbering_xml_tests.py @@ -2,11 +2,12 @@ from nose.tools import istest, assert_equal from mammoth.docx.xmlparser import element as xml_element from mammoth.docx.numbering_xml import read_numbering_xml_element +from mammoth.docx.styles_xml import Styles @istest def find_level_returns_none_if_num_with_id_cannot_be_found(): - numbering = read_numbering_xml_element(xml_element("w:numbering")) + numbering = _read_numbering_xml_element(xml_element("w:numbering")) assert_equal(None, numbering.find_level("47", "0")) @@ -27,23 +28,30 @@ _sample_numbering_xml = xml_element("w:numbering", {}, [ @istest def level_includes_level_index(): - numbering = read_numbering_xml_element(_sample_numbering_xml) + numbering = _read_numbering_xml_element(_sample_numbering_xml) assert_equal("0", numbering.find_level("47", "0").level_index) assert_equal("1", numbering.find_level("47", "1").level_index) @istest def list_is_not_ordered_if_formatted_as_bullet(): - numbering = read_numbering_xml_element(_sample_numbering_xml) + numbering = _read_numbering_xml_element(_sample_numbering_xml) assert_equal(False, numbering.find_level("47", "0").is_ordered) @istest def list_is_ordered_if_formatted_as_decimal(): - numbering = read_numbering_xml_element(_sample_numbering_xml) + numbering = _read_numbering_xml_element(_sample_numbering_xml) assert_equal(True, numbering.find_level("47", "1").is_ordered) @istest def find_level_returns_none_if_level_cannot_be_found(): - numbering = read_numbering_xml_element(_sample_numbering_xml) + numbering = _read_numbering_xml_element(_sample_numbering_xml) assert_equal(None, numbering.find_level("47", "2")) + + +def _read_numbering_xml_element(element, styles=None): + if styles is None: + styles = Styles.EMPTY + + return read_numbering_xml_element(element, styles=styles) |
