Skip to content

Commit 82fbefc

Browse files
author
Steve Canny
committed
acpt: add scenarios for BaseStyle.quick_style
1 parent a6b429b commit 82fbefc

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

features/steps/styles.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ def given_a_style_having_priority_of_setting(context, setting):
9696
context.style = document.styles[style_name]
9797

9898

99+
@given('a style having quick-style set {setting}')
100+
def given_a_style_having_quick_style_setting(context, setting):
101+
document = Document(test_docx('sty-behav-props'))
102+
style_name = {
103+
'on': 'Foo',
104+
'off': 'Bar',
105+
'no setting': 'Baz',
106+
}[setting]
107+
context.style = document.styles[style_name]
108+
109+
99110
@given('a style having unhide-when-used set {setting}')
100111
def given_a_style_having_unhide_when_used_setting(context, setting):
101112
document = Document(test_docx('sty-behav-props'))
@@ -154,6 +165,12 @@ def when_I_assign_value_to_style_priority(context, value):
154165
style.priority = new_value
155166

156167

168+
@when('I assign {value} to style.quick_style')
169+
def when_I_assign_value_to_style_quick_style(context, value):
170+
style, new_value = context.style, bool_vals[value]
171+
style.quick_style = new_value
172+
173+
157174
@when('I assign {value} to style.unhide_when_used')
158175
def when_I_assign_value_to_style_unhide_when_used(context, value):
159176
style, new_value = context.style, bool_vals[value]
@@ -265,6 +282,12 @@ def then_style_priority_is_value(context, value):
265282
assert style.priority == expected_value
266283

267284

285+
@then('style.quick_style is {value}')
286+
def then_style_quick_style_is_value(context, value):
287+
style, expected_value = context.style, bool_vals[value]
288+
assert style.quick_style is expected_value
289+
290+
268291
@then('style.style_id is the {which} style id')
269292
def then_style_style_id_is_the_which_style_id(context, which):
270293
expected_style_id = {

features/sty-style-props.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,30 @@ Feature: Get and set style properties
8181
| 42 | None | None |
8282

8383

84+
@wip
85+
Scenario Outline: Get quick-style value
86+
Given a style having quick-style set <setting>
87+
Then style.quick_style is <value>
88+
89+
Examples: Style quick-style values
90+
| setting | value |
91+
| on | True |
92+
| off | False |
93+
| no setting | False |
94+
95+
96+
@wip
97+
Scenario Outline: Set quick-style value
98+
Given a style having quick-style set <setting>
99+
When I assign <new-value> to style.quick_style
100+
Then style.quick_style is <value>
101+
102+
Examples: Style quick_style values
103+
| setting | new-value | value |
104+
| no setting | True | True |
105+
| on | False | False |
106+
107+
84108
Scenario: Get style id
85109
Given a style having a known style id
86110
Then style.style_id is the known style id

0 commit comments

Comments
 (0)