Skip to content

Commit 100f07b

Browse files
author
Steve Canny
committed
acpt: add scenario for Section page size setters
1 parent 6202ca6 commit 100f07b

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

features/sct-section-props.feature

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ Feature: Access and change section properties
2929
| NEW_COLUMN | None | NEW_PAGE |
3030

3131

32-
Scenario: Get section page width
32+
Scenario: Get section page size
3333
Given a section having known page dimension
3434
Then the reported page width is 8.5 inches
3535
And the reported page height is 11 inches
36+
37+
38+
@wip
39+
Scenario: Set section page size
40+
Given a section having known page dimension
41+
When I set the section page width to 11 inches
42+
And I set the section page height to 8.5 inches
43+
Then the reported page width is 11 inches
44+
And the reported page height is 8.5 inches

features/steps/section.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ def given_a_section_having_start_type(context, start_type):
3838

3939
# when =====================================================
4040

41+
@when('I set the section page height to {y} inches')
42+
def when_I_set_the_section_page_height_to_y_inches(context, y):
43+
context.section.page_height = Inches(float(y))
44+
45+
46+
@when('I set the section page width to {x} inches')
47+
def when_I_set_the_section_page_width_to_x_inches(context, x):
48+
context.section.page_width = Inches(float(x))
49+
50+
4151
@when('I set the section start type to {start_type}')
4252
def when_I_set_the_section_start_type_to_start_type(context, start_type):
4353
new_start_type = {
@@ -53,14 +63,14 @@ def when_I_set_the_section_start_type_to_start_type(context, start_type):
5363

5464
# then =====================================================
5565

56-
@then('the reported page width is 8.5 inches')
57-
def then_the_reported_page_width_is_width(context):
58-
assert context.section.page_width == Inches(8.5)
66+
@then('the reported page width is {x} inches')
67+
def then_the_reported_page_width_is_width(context, x):
68+
assert context.section.page_width == Inches(float(x))
5969

6070

61-
@then('the reported page height is 11 inches')
62-
def then_the_reported_page_height_is_11_inches(context):
63-
assert context.section.page_height == Inches(11)
71+
@then('the reported page height is {y} inches')
72+
def then_the_reported_page_height_is_11_inches(context, y):
73+
assert context.section.page_height == Inches(float(y))
6474

6575

6676
@then('the reported section start type is {start_type}')

0 commit comments

Comments
 (0)