@@ -464,6 +464,10 @@ def StyleFactory_(self, request):
464464
465465class Describe_ParagraphStyle (object ):
466466
467+ def it_knows_its_next_paragraph_style (self , next_get_fixture ):
468+ style , expected_value = next_get_fixture
469+ assert style .next_paragraph_style == expected_value
470+
467471 def it_provides_access_to_its_paragraph_format (self , parfmt_fixture ):
468472 style , ParagraphFormat_ , paragraph_format_ = parfmt_fixture
469473 paragraph_format = style .paragraph_format
@@ -472,6 +476,32 @@ def it_provides_access_to_its_paragraph_format(self, parfmt_fixture):
472476
473477 # fixtures -------------------------------------------------------
474478
479+ @pytest .fixture (params = [
480+ ('H1' , 'Body' ),
481+ ('H2' , 'H2' ),
482+ ('Body' , 'Body' ),
483+ ('Foo' , 'Foo' ),
484+ ])
485+ def next_get_fixture (self , request ):
486+ style_name , next_style_name = request .param
487+ styles = element (
488+ 'w:styles/('
489+ 'w:style{w:type=paragraph,w:styleId=H1}/w:next{w:val=Body},'
490+ 'w:style{w:type=paragraph,w:styleId=H2}/w:next{w:val=Char},'
491+ 'w:style{w:type=paragraph,w:styleId=Body},'
492+ 'w:style{w:type=paragraph,w:styleId=Foo}/w:next{w:val=Bar},'
493+ 'w:style{w:type=character,w:styleId=Char})'
494+ )
495+ style_names = ['H1' , 'H2' , 'Body' , 'Foo' , 'Char' ]
496+ style_elm = styles [style_names .index (style_name )]
497+ next_style_elm = styles [style_names .index (next_style_name )]
498+ style = _ParagraphStyle (style_elm )
499+ if style_name == 'H1' :
500+ next_style = _ParagraphStyle (next_style_elm )
501+ else :
502+ next_style = style
503+ return style , next_style
504+
475505 @pytest .fixture
476506 def parfmt_fixture (self , ParagraphFormat_ , paragraph_format_ ):
477507 style = _ParagraphStyle (element ('w:style' ))
0 commit comments