Skip to content

Commit 945ffb5

Browse files
author
Steve Canny
committed
acpt: add scenario for add picture from stream
1 parent 12336e7 commit 945ffb5

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

features/shp-add-inline-picture.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ Feature: Add inline picture
88
When I add an inline picture to the document
99
Then its inline shape type is WD_INLINE_SHAPE.PICTURE
1010
And the document contains the inline picture
11+
12+
Scenario: Add inline picture from stream
13+
Given a document
14+
When I add an inline picture from a file-like object
15+
Then its inline shape type is WD_INLINE_SHAPE.PICTURE
16+
And the document contains the inline picture

features/steps/shape.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ def given_inline_shape_known_to_be_shape_of_type(context, shp_of_type):
4848

4949
# when =====================================================
5050

51+
@when('I add an inline picture from a file-like object')
52+
def when_add_inline_picture_from_file_like_object(context):
53+
document = context.document
54+
with open(test_file_path('monty-truth.png')) as f:
55+
context.inline_shape = (
56+
document.add_inline_picture(f)
57+
)
58+
59+
5160
@when('I add an inline picture to the document')
5261
def when_add_inline_picture_to_document(context):
5362
document = context.document

0 commit comments

Comments
 (0)