Skip to content

Commit 0bed6a8

Browse files
author
Steve Canny
committed
acpt: add shp-inline-shape-size.feature
1 parent de9bcfd commit 0bed6a8

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Feature: Query and change dimensions of inline shape
2+
In order to adjust the display size of an inline shape
3+
As a python-docx developer
4+
I need to query and change the width and height of an inline shape
5+
6+
@wip
7+
Scenario: Query inline shape dimensions
8+
Given an inline shape of known dimensions
9+
Then the dimensions of the inline shape match the known values
10+
11+
@wip
12+
Scenario: Change inline shape dimensions
13+
Given an inline shape of known dimensions
14+
When I change the dimensions of the inline shape
15+
Then the dimensions of the inline shape match the new values

features/steps/shape.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def given_inline_shape_collection_containing_two_shapes(context):
3232
context.inline_shapes = document.inline_shapes
3333

3434

35+
@given('an inline shape of known dimensions')
36+
def given_inline_shape_of_known_dimensions(context):
37+
document = Document(test_docx('shp-inline-shape-access'))
38+
context.inline_shape = document.inline_shapes[0]
39+
40+
3541
@given('an inline shape known to be {shp_of_type}')
3642
def given_inline_shape_known_to_be_shape_of_type(context, shp_of_type):
3743
inline_shape_idx = {
@@ -107,6 +113,13 @@ def then_inline_shape_type_is_shape_type(context, shape_type):
107113
assert inline_shape.type == expected_value
108114

109115

116+
@then('the dimensions of the inline shape match the known values')
117+
def then_dimensions_of_inline_shape_match_known_values(context):
118+
inline_shape = context.inline_shape
119+
assert inline_shape.width == 914400, 'got %s' % inline_shape.width
120+
assert inline_shape.height == 914400, 'got %s' % inline_shape.height
121+
122+
110123
@then('the document contains the inline picture')
111124
def then_the_document_contains_the_inline_picture(context):
112125
document = context.document

0 commit comments

Comments
 (0)