Esempio n. 1
0
 def body_with_tables(self):
     body_elm = (
         a_body().with_nsdecls()
                 .with_child(a_tbl())
                 .with_child(a_tbl())
                 .element
     )
     return _Body(body_elm)
Esempio n. 2
0
 def body_with_paragraphs(self):
     body_elm = (
         a_body().with_nsdecls()
                 .with_child(a_p())
                 .with_child(a_p())
                 .element
     )
     return _Body(body_elm)
Esempio n. 3
0
 def body_with_tables(self):
     body_elm = (
         a_body().with_nsdecls()
                 .with_child(a_tbl())
                 .with_child(a_tbl())
                 .element
     )
     return _Body(body_elm)
Esempio n. 4
0
 def body_with_paragraphs(self):
     body_elm = (
         a_body().with_nsdecls()
                 .with_child(a_p())
                 .with_child(a_p())
                 .element
     )
     return _Body(body_elm)
Esempio n. 5
0
    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
Esempio n. 6
0
 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
Esempio n. 7
0
 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
Esempio n. 8
0
    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
Esempio n. 9
0
 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
Esempio n. 10
0
 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
Esempio n. 11
0
 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
Esempio n. 12
0
 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
Esempio n. 13
0
 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
Esempio n. 14
0
 def paragraphs_fixture(self):
     return _Body(element('w:body/(w:p, w:p)'), None)
Esempio n. 15
0
 def tables_fixture(self):
     return _Body(element('w:body/(w:tbl, w:tbl)'), None)
Esempio n. 16
0
 def tables_fixture(self):
     return _Body(element('w:body/(w:tbl, w:tbl)'), None)
Esempio n. 17
0
 def paragraphs_fixture(self):
     return _Body(element('w:body/(w:p, w:p)'), None)
Esempio n. 18
0
 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