Skip to content

Commit ba72289

Browse files
author
Steve Canny
committed
acpt: migrate num-access-numbering-part.feature
1 parent 38272b4 commit ba72289

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

docx/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def paragraphs(self):
100100
"""
101101
return self._document_part.paragraphs
102102

103+
@property
104+
def part(self):
105+
return self._document.part
106+
103107
def save(self, path_or_stream):
104108
"""
105109
Save this document to *path_or_stream*, which can be either a path to

features/num-get-numbering-part.feature renamed to features/num-access-numbering-part.feature

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
Feature: Get the document numbering part
2-
In order to query and modify numbering settings
3-
As a programmer using the advanced python-docx API
1+
Feature: Access the document numbering part
2+
In order to operate on numbering settings
3+
As a developer using python-docx
44
I need access to the numbering part of the document
55

6+
7+
@wip
68
Scenario: Get an existing numbering part from document
79
Given a document having a numbering part
810
When I get the numbering part from the document

features/steps/numbering.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515

1616
@given('a document having a numbering part')
1717
def given_a_document_having_a_numbering_part(context):
18-
docx_path = test_docx('num-having-numbering-part')
19-
context.document = Document(docx_path)
18+
context.document = Document(test_docx('num-having-numbering-part'))
2019

2120

2221
# when ====================================================
2322

2423
@when('I get the numbering part from the document')
2524
def when_get_numbering_part_from_document(context):
2625
document = context.document
27-
context.numbering_part = document.numbering_part
26+
context.numbering_part = document.part.numbering_part
2827

2928

3029
# then =====================================================

0 commit comments

Comments
 (0)