@@ -140,6 +140,19 @@ def given_a_style_having_locked_setting(context, setting):
140140 context .style = document .styles [style_name ]
141141
142142
143+ @given ('a style having next paragraph style set to {setting}' )
144+ def given_a_style_having_next_paragraph_style_setting (context , setting ):
145+ document = Document (test_docx ('sty-known-styles' ))
146+ style_name = {
147+ 'Sub Normal' : 'Citation' ,
148+ 'Foobar' : 'Sub Normal' ,
149+ 'Base' : 'Foo' ,
150+ 'no setting' : 'Base' ,
151+ }[setting ]
152+ context .styles = document .styles
153+ context .style = document .styles [style_name ]
154+
155+
143156@given ('a style having priority of {setting}' )
144157def given_a_style_having_priority_of_setting (context , setting ):
145158 document = Document (test_docx ('sty-behav-props' ))
@@ -248,6 +261,13 @@ def when_I_assign_value_to_style_locked(context, value):
248261 style .locked = new_value
249262
250263
264+ @when ('I assign {value} to style.next_paragraph_style' )
265+ def when_I_assign_value_to_style_next_paragraph_style (context , value ):
266+ styles , style = context .styles , context .style
267+ new_value = None if value == 'None' else styles [value ]
268+ style .next_paragraph_style = new_value
269+
270+
251271@when ('I assign {value} to style.priority' )
252272def when_I_assign_value_to_style_priority (context , value ):
253273 style = context .style
@@ -426,6 +446,14 @@ def then_style_name_is_the_which_name(context, which):
426446 assert style .name == expected_name
427447
428448
449+ @then ('style.next_paragraph_style is {value}' )
450+ def then_style_next_paragraph_style_is_value (context , value ):
451+ style , styles = context .style , context .styles
452+ actual_value = style .next_paragraph_style
453+ expected_value = styles [value ]
454+ assert actual_value == expected_value , 'got %s' % actual_value
455+
456+
429457@then ('style.paragraph_format is the ParagraphFormat object for the style' )
430458def then_style_paragraph_format_is_the_ParagraphFormat_object (context ):
431459 style = context .style
0 commit comments