@@ -86,6 +86,17 @@ def given_a_style_having_hidden_set_setting(context, setting):
8686 context .style = document .styles [style_name ]
8787
8888
89+ @given ('a style having locked set {setting}' )
90+ def given_a_style_having_locked_setting (context , setting ):
91+ document = Document (test_docx ('sty-behav-props' ))
92+ style_name = {
93+ 'on' : 'Foo' ,
94+ 'off' : 'Bar' ,
95+ 'no setting' : 'Baz' ,
96+ }[setting ]
97+ context .style = document .styles [style_name ]
98+
99+
89100@given ('a style having priority of {setting}' )
90101def given_a_style_having_priority_of_setting (context , setting ):
91102 document = Document (test_docx ('sty-behav-props' ))
@@ -158,6 +169,12 @@ def when_I_assign_value_to_style_hidden(context, value):
158169 style .hidden = new_value
159170
160171
172+ @when ('I assign {value} to style.locked' )
173+ def when_I_assign_value_to_style_locked (context , value ):
174+ style , new_value = context .style , bool_vals [value ]
175+ style .locked = new_value
176+
177+
161178@when ('I assign {value} to style.priority' )
162179def when_I_assign_value_to_style_priority (context , value ):
163180 style = context .style
@@ -257,6 +274,12 @@ def then_style_hidden_is_value(context, value):
257274 assert style .hidden is expected_value
258275
259276
277+ @then ('style.locked is {value}' )
278+ def then_style_locked_is_value (context , value ):
279+ style , expected_value = context .style , bool_vals [value ]
280+ assert style .locked is expected_value
281+
282+
260283@then ('style.name is the {which} name' )
261284def then_style_name_is_the_which_name (context , which ):
262285 expected_name = {
0 commit comments