-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathnumbering.py
More file actions
32 lines (18 loc) · 952 Bytes
/
numbering.py
File metadata and controls
32 lines (18 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Step implementations for numbering-related features."""
from behave import given, then, when
from docx import Document
from helpers import test_docx
# given ===================================================
@given("a document having a numbering part")
def given_a_document_having_a_numbering_part(context):
context.document = Document(test_docx("num-having-numbering-part"))
# when ====================================================
@when("I get the numbering part from the document")
def when_get_numbering_part_from_document(context):
document = context.document
context.numbering_part = document.part.numbering_part
# then =====================================================
@then("the numbering part has the expected numbering definitions")
def then_numbering_part_has_expected_numbering_definitions(context):
numbering_part = context.numbering_part
assert len(numbering_part.numbering_definitions) == 10