MCPcopy Index your code
hub / github.com/python-openxml/python-docx / it_can_add_a_row

Method it_can_add_a_row

tests/test_table.py:34–44  ·  view source on GitHub ↗
(self, document_: Mock)

Source from the content-addressed store, hash-verified

32 """Unit-test suite for `docx.table._Rows` objects."""
33
34 def it_can_add_a_row(self, document_: Mock):
35 snippets = snippet_seq("add-row-col")
36 tbl = cast(CT_Tbl, parse_xml(snippets[0]))
37 table = Table(tbl, document_)
38
39 row = table.add_row()
40
41 assert table._tbl.xml == snippets[1]
42 assert isinstance(row, _Row)
43 assert row._tr is table._tbl.tr_lst[-1]
44 assert row._parent is table
45
46 def it_can_add_a_column(self, document_: Mock):
47 snippets = snippet_seq("add-row-col")

Callers

nothing calls this directly

Calls 4

add_rowMethod · 0.95
parse_xmlFunction · 0.90
TableClass · 0.90
snippet_seqFunction · 0.85

Tested by

no test coverage detected