Skip to content

Commit 56cc5f7

Browse files
author
Steve Canny
committed
acpt: add scenarios for Section margin setters
1 parent 445d5d2 commit 56cc5f7

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

features/sct-section-props.feature

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,20 @@ Feature: Access and change section properties
7474
And the reported gutter margin is 0.25 inches
7575
And the reported header margin is 0.5 inches
7676
And the reported footer margin is 0.75 inches
77+
78+
79+
@wip
80+
Scenario Outline: Set section page margins
81+
Given a section having known page margins
82+
When I set the <margin-type> margin to <length> inches
83+
Then the reported <margin-type> margin is <length> inches
84+
85+
Examples: Section margin settings
86+
| margin-type | length |
87+
| left | 1.0 |
88+
| right | 1.25 |
89+
| top | 0.75 |
90+
| bottom | 1.5 |
91+
| header | 0.25 |
92+
| footer | 0.5 |
93+
| gutter | 0.25 |

features/steps/section.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ def given_a_section_having_known_orientation(context, orientation):
5454

5555
# when =====================================================
5656

57+
@when('I set the {margin_side} margin to {inches} inches')
58+
def when_I_set_the_margin_side_length(context, margin_side, inches):
59+
prop_name = {
60+
'left': 'left_margin',
61+
'right': 'right_margin',
62+
'top': 'top_margin',
63+
'bottom': 'bottom_margin',
64+
'gutter': 'gutter',
65+
'header': 'header_distance',
66+
'footer': 'footer_distance',
67+
}[margin_side]
68+
new_value = Inches(float(inches))
69+
setattr(context.section, prop_name, new_value)
70+
71+
5772
@when('I set the section orientation to {orientation}')
5873
def when_I_set_the_section_orientation(context, orientation):
5974
new_orientation = {

0 commit comments

Comments
 (0)