X Tutup
Skip to content

Commit 2379769

Browse files
author
Steve Canny
committed
acpt: add num-get-numbering-part.feature
1 parent 684b91d commit 2379769

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Feature: Get the document numbering part
2+
In order query and modify numbering settings
3+
As a programmer using the advanced python-docx API
4+
I need access to the numbering part of the document
5+
6+
@wip
7+
Scenario: Get an existing numbering part from document
8+
Given a document having a numbering part
9+
When I get the numbering part from the document
10+
Then the numbering part has the expected numbering definitions

features/steps/numbering.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# encoding: utf-8
2+
3+
"""
4+
Step implementations for numbering-related features
5+
"""
6+
7+
from behave import given, then, when
8+
9+
from docx import Document
10+
11+
from helpers import test_docx
12+
13+
14+
# given ===================================================
15+
16+
@given('a document having a numbering part')
17+
def given_a_document_having_a_numbering_part(context):
18+
docx_path = test_docx('num-having-numbering-part')
19+
context.document = Document(docx_path)
20+
21+
22+
# when ====================================================
23+
24+
@when('I get the numbering part from the document')
25+
def when_get_numbering_part_from_document(context):
26+
document = context.document
27+
context.numbering_part = document.numbering_part
28+
29+
30+
# then =====================================================
31+
32+
@then('the numbering part has the expected numbering definitions')
33+
def then_numbering_part_has_expected_numbering_definitions(context):
34+
numbering_part = context.numbering_part
35+
assert len(numbering_part.numbering_definitions) == 10
23.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)
X Tutup