コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #5
0
ファイル: test_document.py プロジェクト: Jackieee/python-docx
    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
コード例 #6
0
ファイル: test_document.py プロジェクト: Jackieee/python-docx
 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
コード例 #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
コード例 #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
コード例 #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
コード例 #10
0
ファイル: test_document.py プロジェクト: Jackieee/python-docx
 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
コード例 #11
0
ファイル: test_document.py プロジェクト: AKimZ/python-docx
 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
コード例 #12
0
ファイル: test_document.py プロジェクト: wtayyeb/python-docx
 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
コード例 #13
0
ファイル: test_document.py プロジェクト: wtayyeb/python-docx
 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
コード例 #14
0
ファイル: test_document.py プロジェクト: wtayyeb/python-docx
 def paragraphs_fixture(self):
     return _Body(element('w:body/(w:p, w:p)'), None)
コード例 #15
0
ファイル: test_document.py プロジェクト: wtayyeb/python-docx
 def tables_fixture(self):
     return _Body(element('w:body/(w:tbl, w:tbl)'), None)
コード例 #16
0
ファイル: test_document.py プロジェクト: eyalbd1/python-docx
 def tables_fixture(self):
     return _Body(element('w:body/(w:tbl, w:tbl)'), None)
コード例 #17
0
ファイル: test_document.py プロジェクト: eyalbd1/python-docx
 def paragraphs_fixture(self):
     return _Body(element('w:body/(w:p, w:p)'), None)
コード例 #18
0
ファイル: test_document.py プロジェクト: eyalbd1/python-docx
 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