@@ -28,6 +28,13 @@ def given_a_run_having_bold_set_on(context):
2828 context .run = run
2929
3030
31+ @given ('a run having italic set on' )
32+ def given_a_run_having_italic_set_on (context ):
33+ run = Document ().add_paragraph ().add_run ()
34+ run .italic = True
35+ context .run = run
36+
37+
3138# when ====================================================
3239
3340@when ('I add a column break' )
@@ -55,6 +62,13 @@ def when_assign_true_to_its_bold_property(context, value_str):
5562 run .bold = value
5663
5764
65+ @when ('I assign {value_str} to its italic property' )
66+ def when_assign_true_to_its_italic_property (context , value_str ):
67+ value = {'True' : True , 'False' : False , 'None' : None }[value_str ]
68+ run = context .run
69+ run .italic = value
70+
71+
5872# then =====================================================
5973
6074@then ('it is a column break' )
@@ -91,13 +105,31 @@ def then_run_appears_in_bold_typeface(context):
91105 assert run .bold is True
92106
93107
108+ @then ('the run appears in italic typeface' )
109+ def then_run_appears_in_italic_typeface (context ):
110+ run = context .run
111+ assert run .italic is True
112+
113+
94114@then ('the run appears with its inherited bold setting' )
95115def then_run_appears_with_its_inherited_bold_setting (context ):
96116 run = context .run
97117 assert run .bold is None
98118
99119
120+ @then ('the run appears with its inherited italic setting' )
121+ def then_run_appears_with_its_inherited_italic_setting (context ):
122+ run = context .run
123+ assert run .italic is None
124+
125+
100126@then ('the run appears without bold regardless of its style hierarchy' )
101127def then_run_appears_without_bold_regardless (context ):
102128 run = context .run
103129 assert run .bold is False
130+
131+
132+ @then ('the run appears without italic regardless of its style hierarchy' )
133+ def then_run_appears_without_italic_regardless (context ):
134+ run = context .run
135+ assert run .italic is False
0 commit comments