@@ -140,6 +140,19 @@ def given_a_style_having_locked_setting(context, setting):
140
140
context .style = document .styles [style_name ]
141
141
142
142
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
+
143
156
@given ('a style having priority of {setting}' )
144
157
def given_a_style_having_priority_of_setting (context , setting ):
145
158
document = Document (test_docx ('sty-behav-props' ))
@@ -248,6 +261,13 @@ def when_I_assign_value_to_style_locked(context, value):
248
261
style .locked = new_value
249
262
250
263
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
+
251
271
@when ('I assign {value} to style.priority' )
252
272
def when_I_assign_value_to_style_priority (context , value ):
253
273
style = context .style
@@ -426,6 +446,14 @@ def then_style_name_is_the_which_name(context, which):
426
446
assert style .name == expected_name
427
447
428
448
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
+
429
457
@then ('style.paragraph_format is the ParagraphFormat object for the style' )
430
458
def then_style_paragraph_format_is_the_ParagraphFormat_object (context ):
431
459
style = context .style
0 commit comments