X Tutup
Skip to content

Commit 4948b90

Browse files
author
Steve Canny
committed
acpt: add scenario for Run.underline setter
1 parent 29a2454 commit 4948b90

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

features/run-enum-props.feature

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,23 @@ Feature: Query or apply enumerated run property
1414
| no | False |
1515
| single | True |
1616
| double | WD_UNDERLINE.DOUBLE |
17+
18+
19+
@wip
20+
Scenario Outline: Change underline setting for a run
21+
Given a run having <underline-type> underline
22+
When I set the run underline to <new-underline-value>
23+
Then the run underline property value is <expected-underline-value>
24+
25+
Examples: underline property values
26+
| underline-type | new-underline-value | expected-underline-value |
27+
| inherited | True | True |
28+
| inherited | False | False |
29+
| inherited | None | None |
30+
| inherited | WD_UNDERLINE.SINGLE | True |
31+
| inherited | WD_UNDERLINE.DOUBLE | WD_UNDERLINE.DOUBLE |
32+
| single | None | None |
33+
| single | True | True |
34+
| single | False | False |
35+
| single | WD_UNDERLINE.SINGLE | True |
36+
| single | WD_UNDERLINE.DOUBLE | WD_UNDERLINE.DOUBLE |

features/steps/text.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ def when_I_set_the_character_style_of_the_run(context, char_style):
9393
context.run.style = style_value
9494

9595

96+
@when('I set the run underline to {underline_value}')
97+
def when_I_set_the_run_underline_to_value(context, underline_value):
98+
new_value = {
99+
'True': True, 'False': False, 'None': None,
100+
'WD_UNDERLINE.SINGLE': WD_UNDERLINE.SINGLE,
101+
'WD_UNDERLINE.DOUBLE': WD_UNDERLINE.DOUBLE,
102+
}[underline_value]
103+
context.run.underline = new_value
104+
105+
96106
# then =====================================================
97107

98108
@then('it is a column break')

0 commit comments

Comments
 (0)
X Tutup