Skip to content

Commit a231eb1

Browse files
author
Steve Canny
committed
acpt: add scenario for Document.paragraphs
1 parent 6b92497 commit a231eb1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

features/doc-access-collections.feature

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ Feature: Access document collections
77
Scenario: Access the inline shapes collection of a document
88
Given a document having inline shapes
99
Then I can access the inline shape collection of the document
10+
11+
12+
Scenario: Access the paragraphs in the document body as a list
13+
Given a document containing three paragraphs
14+
Then document.paragraphs is a list containing three paragraphs

features/steps/document.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ def when_I_change_the_new_section_layout_to_landscape(context):
151151

152152
# then ====================================================
153153

154+
@then('document.paragraphs is a list containing three paragraphs')
155+
def then_document_paragraphs_is_a_list_containing_three_paragraphs(context):
156+
document = context.document
157+
paragraphs = document.paragraphs
158+
assert isinstance(paragraphs, list)
159+
assert len(paragraphs) == 3
160+
161+
154162
@then('I can access a section by index')
155163
def then_I_can_access_a_section_by_index(context):
156164
sections = context.sections

0 commit comments

Comments
 (0)