X Tutup
Skip to content

Commit f6036e0

Browse files
author
Steve Canny
committed
acpt: add scenarios for Section.orientation setter
1 parent 7b5e961 commit f6036e0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

features/sct-section-props.feature

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,16 @@ Feature: Access and change section properties
5151
| orientation | reported-orientation |
5252
| landscape | WD_ORIENT.LANDSCAPE |
5353
| portrait | WD_ORIENT.PORTRAIT |
54+
55+
56+
@wip
57+
Scenario Outline: Set section orientation
58+
Given a section known to have <initial-orientation> orientation
59+
When I set the section orientation to <new-orientation>
60+
Then the reported page orientation is <reported-orientation>
61+
62+
Examples: Section page orientations
63+
| initial-orientation | new-orientation | reported-orientation |
64+
| portrait | WD_ORIENT.LANDSCAPE | WD_ORIENT.LANDSCAPE |
65+
| landscape | WD_ORIENT.PORTRAIT | WD_ORIENT.PORTRAIT |
66+
| landscape | None | WD_ORIENT.PORTRAIT |

features/steps/section.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ def given_a_section_having_known_orientation(context, orientation):
4848

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

51+
@when('I set the section orientation to {orientation}')
52+
def when_I_set_the_section_orientation(context, orientation):
53+
new_orientation = {
54+
'WD_ORIENT.PORTRAIT': WD_ORIENT.PORTRAIT,
55+
'WD_ORIENT.LANDSCAPE': WD_ORIENT.LANDSCAPE,
56+
'None': None,
57+
}[orientation]
58+
context.section.orientation = new_orientation
59+
60+
5161
@when('I set the section page height to {y} inches')
5262
def when_I_set_the_section_page_height_to_y_inches(context, y):
5363
context.section.page_height = Inches(float(y))

0 commit comments

Comments
 (0)
X Tutup