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

Method it_can_add_a_column

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

Source from the content-addressed store, hash-verified

44 assert row._parent is table
45
46 def it_can_add_a_column(self, document_: Mock):
47 snippets = snippet_seq("add-row-col")
48 tbl = cast(CT_Tbl, parse_xml(snippets[0]))
49 table = Table(tbl, document_)
50
51 column = table.add_column(Inches(1.5))
52
53 assert table._tbl.xml == snippets[2]
54 assert isinstance(column, _Column)
55 assert column._gridCol is table._tbl.tblGrid.gridCol_lst[-1]
56 assert column._parent is table
57
58 def it_provides_access_to_a_cell_by_row_and_col_indices(self, table: Table):
59 for row_idx in range(2):

Callers

nothing calls this directly

Calls 5

add_columnMethod · 0.95
parse_xmlFunction · 0.90
TableClass · 0.90
InchesClass · 0.90
snippet_seqFunction · 0.85

Tested by

no test coverage detected