def body_with_tables(self): body_elm = ( a_body().with_nsdecls() .with_child(a_tbl()) .with_child(a_tbl()) .element ) return _Body(body_elm)
def body_with_paragraphs(self): body_elm = ( a_body().with_nsdecls() .with_child(a_p()) .with_child(a_p()) .element ) return _Body(body_elm)
def body_with_tables(self): body_elm = ( a_body().with_nsdecls() .with_child(a_tbl()) .with_child(a_tbl()) .element ) return _Body(body_elm)
def body_with_paragraphs(self): body_elm = ( a_body().with_nsdecls() .with_child(a_p()) .with_child(a_p()) .element ) return _Body(body_elm)
def add_table_fixture(self, request): p_count, has_sectPr = request.param body_bldr = self._body_bldr(p_count=p_count, sectPr=has_sectPr) body = _Body(body_bldr.element) tbl_bldr = self._tbl_bldr() body_bldr = self._body_bldr(p_count=p_count, tbl_bldr=tbl_bldr, sectPr=has_sectPr) expected_xml = body_bldr.xml() return body, expected_xml
def add_paragraph_fixture(self, request): p_count, has_sectPr = request.param # body element ----------------- body_bldr = self._body_bldr(p_count=p_count, sectPr=has_sectPr) body_elm = body_bldr.element body = _Body(body_elm) # expected XML ----------------- p_count += 1 body_bldr = self._body_bldr(p_count=p_count, sectPr=has_sectPr) expected_xml = body_bldr.xml() return body, expected_xml
def add_paragraph_fixture(self, request): p_count, has_sectPr = request.param # body element ----------------- body_bldr = self._body_bldr(p_count=p_count, sectPr=has_sectPr) body_elm = body_bldr.element body = _Body(body_elm) # expected XML ----------------- p_count += 1 body_bldr = self._body_bldr(p_count=p_count, sectPr=has_sectPr) expected_xml = body_bldr.xml() return body, expected_xml
def add_table_fixture(self, request): p_count, has_sectPr = request.param body_bldr = self._body_bldr(p_count=p_count, sectPr=has_sectPr) body = _Body(body_bldr.element) tbl_bldr = self._tbl_bldr() body_bldr = self._body_bldr( p_count=p_count, tbl_bldr=tbl_bldr, sectPr=has_sectPr ) expected_xml = body_bldr.xml() return body, expected_xml
def clear_content_fixture(self, request): has_sectPr = request.param # body element ----------------- body_bldr = a_body().with_nsdecls() body_bldr.with_child(a_p()) if has_sectPr: body_bldr.with_child(a_sectPr()) body_elm = body_bldr.element body = _Body(body_elm) # expected XML ----------------- body_bldr = a_body().with_nsdecls() if has_sectPr: body_bldr.with_child(a_sectPr()) expected_xml = body_bldr.xml() return body, expected_xml
def clear_content_fixture(self, request): has_sectPr = request.param # body element ----------------- body_bldr = a_body().with_nsdecls() body_bldr.with_child(a_p()) if has_sectPr: body_bldr.with_child(a_sectPr()) body_elm = body_bldr.element body = _Body(body_elm) # expected XML ----------------- body_bldr = a_body().with_nsdecls() if has_sectPr: body_bldr.with_child(a_sectPr()) expected_xml = body_bldr.xml() return body, expected_xml
def add_table_fixture(self, request): body_cxml, rows, cols, after_cxml = request.param body = _Body(element(body_cxml), None) expected_xml = xml(after_cxml) return body, rows, cols, expected_xml
def clear_fixture(self, request): before_cxml, after_cxml = request.param body = _Body(element(before_cxml), None) expected_xml = xml(after_cxml) return body, expected_xml
def add_table_fixture(self, request): body_cxml, rows, cols, after_cxml = request.param body = _Body(element(body_cxml), None) expected_xml = xml(after_cxml) return body, rows, cols, expected_xml
def paragraphs_fixture(self): return _Body(element('w:body/(w:p, w:p)'), None)
def tables_fixture(self): return _Body(element('w:body/(w:tbl, w:tbl)'), None)
def tables_fixture(self): return _Body(element('w:body/(w:tbl, w:tbl)'), None)
def paragraphs_fixture(self): return _Body(element('w:body/(w:p, w:p)'), None)
def clear_fixture(self, request): before_cxml, after_cxml = request.param body = _Body(element(before_cxml), None) expected_xml = xml(after_cxml) return body, expected_xml