def next_set_fixture(self, request): style_name, next_style_name, style_cxml = request.param styles = element("w:styles/(" "w:style{w:type=paragraph,w:styleId=H}," "w:style{w:type=paragraph,w:styleId=B})") style_elms = {"H": styles[0], "B": styles[1]} style = _ParagraphStyle(style_elms[style_name]) next_style = None if next_style_name is None else _ParagraphStyle(style_elms[next_style_name]) expected_xml = xml(style_cxml) return style, next_style, expected_xml
def next_set_fixture(self, request): style_name, next_style_name, style_cxml = request.param styles = element('w:styles/(' 'w:style{w:type=paragraph,w:styleId=H},' 'w:style{w:type=paragraph,w:styleId=B})') style_elms = {'H': styles[0], 'B': styles[1]} style = _ParagraphStyle(style_elms[style_name]) next_style = (None if next_style_name is None else _ParagraphStyle( style_elms[next_style_name])) expected_xml = xml(style_cxml) return style, next_style, expected_xml
def next_get_fixture(self, request): style_name, next_style_name = request.param styles = element( 'w:styles/(' 'w:style{w:type=paragraph,w:styleId=H1}/w:next{w:val=Body},' 'w:style{w:type=paragraph,w:styleId=H2}/w:next{w:val=Char},' 'w:style{w:type=paragraph,w:styleId=Body},' 'w:style{w:type=paragraph,w:styleId=Foo}/w:next{w:val=Bar},' 'w:style{w:type=character,w:styleId=Char})') style_names = ['H1', 'H2', 'Body', 'Foo', 'Char'] style_elm = styles[style_names.index(style_name)] next_style_elm = styles[style_names.index(next_style_name)] style = _ParagraphStyle(style_elm) if style_name == 'H1': next_style = _ParagraphStyle(next_style_elm) else: next_style = style return style, next_style
def next_get_fixture(self, request): style_name, next_style_name = request.param styles = element( "w:styles/(" "w:style{w:type=paragraph,w:styleId=H1}/w:next{w:val=Body}," "w:style{w:type=paragraph,w:styleId=H2}/w:next{w:val=Char}," "w:style{w:type=paragraph,w:styleId=Body}," "w:style{w:type=paragraph,w:styleId=Foo}/w:next{w:val=Bar}," "w:style{w:type=character,w:styleId=Char})" ) style_names = ["H1", "H2", "Body", "Foo", "Char"] style_elm = styles[style_names.index(style_name)] next_style_elm = styles[style_names.index(next_style_name)] style = _ParagraphStyle(style_elm) if style_name == "H1": next_style = _ParagraphStyle(next_style_elm) else: next_style = style return style, next_style
def parfmt_fixture(self, ParagraphFormat_, paragraph_format_): style = _ParagraphStyle(element("w:style")) return style, ParagraphFormat_, paragraph_format_
def parfmt_fixture(self, ParagraphFormat_, paragraph_format_): style = _ParagraphStyle(element('w:style')) return style, ParagraphFormat_, paragraph_format_