MCPcopy Create free account
hub / github.com/scanny/python-pptx / it_can_iterate_its_grid_cells

Method it_can_iterate_its_grid_cells

tests/test_table.py:58–69  ·  view source on GitHub ↗
(self, request, _Cell_)

Source from the content-addressed store, hash-verified

56 assert columns is columns_
57
58 def it_can_iterate_its_grid_cells(self, request, _Cell_):
59 tbl = element("a:tbl/(a:tr/(a:tc,a:tc),a:tr/(a:tc,a:tc))")
60 expected_tcs = tbl.xpath(".//a:tc")
61 expected_cells = _Cell_.side_effect = [
62 instance_mock(request, _Cell, name="cell%d" % idx) for idx in range(4)
63 ]
64 table = Table(tbl, None)
65
66 cells = list(table.iter_cells())
67
68 assert cells == expected_cells
69 assert _Cell_.call_args_list == [call(tc, table) for tc in expected_tcs]
70
71 def it_provides_access_to_its_rows(self, request):
72 rows_ = instance_mock(request, _RowCollection)

Callers

nothing calls this directly

Calls 5

iter_cellsMethod · 0.95
TableClass · 0.90
elementFunction · 0.85
instance_mockFunction · 0.85
xpathMethod · 0.45

Tested by

no test coverage detected