@@ -86,6 +86,16 @@ def given_a_style_having_hidden_set_setting(context, setting):
8686 context .style = document .styles [style_name ]
8787
8888
89+ @given ('a style having priority of {setting}' )
90+ def given_a_style_having_priority_of_setting (context , setting ):
91+ document = Document (test_docx ('sty-behav-props' ))
92+ style_name = {
93+ 'no setting' : 'Baz' ,
94+ '42' : 'Foo' ,
95+ }[setting ]
96+ context .style = document .styles [style_name ]
97+
98+
8999@given ('a style of type {style_type}' )
90100def given_a_style_of_type (context , style_type ):
91101 document = Document (test_docx ('sty-known-styles' ))
@@ -126,6 +136,13 @@ def when_I_assign_value_to_style_hidden(context, value):
126136 style .hidden = new_value
127137
128138
139+ @when ('I assign {value} to style.priority' )
140+ def when_I_assign_value_to_style_priority (context , value ):
141+ style = context .style
142+ new_value = None if value == 'None' else int (value )
143+ style .priority = new_value
144+
145+
129146@when ('I call add_style(\' {name}\' , {type_str}, builtin={builtin_str})' )
130147def when_I_call_add_style (context , name , type_str , builtin_str ):
131148 styles = context .document .styles
@@ -224,6 +241,13 @@ def then_style_paragraph_format_is_the_ParagraphFormat_object(context):
224241 assert paragraph_format .element is style .element
225242
226243
244+ @then ('style.priority is {value}' )
245+ def then_style_priority_is_value (context , value ):
246+ style = context .style
247+ expected_value = None if value == 'None' else int (value )
248+ assert style .priority == expected_value
249+
250+
227251@then ('style.style_id is the {which} style id' )
228252def then_style_style_id_is_the_which_style_id (context , which ):
229253 expected_style_id = {
0 commit comments