def col_cells_fixture(self, _cells_, _column_count_): table = Table(None, None) _cells_.return_value = [0, 1, 2, 3, 4, 5, 6, 7, 8] _column_count_.return_value = 3 column_idx = 1 expected_cells = [1, 4, 7] return table, column_idx, expected_cells
def row_cells_fixture(self, _cells_, _column_count_): table = Table(None, None) _cells_.return_value = [0, 1, 2, 3, 4, 5, 6, 7, 8] _column_count_.return_value = 3 row_idx = 1 expected_cells = [3, 4, 5] return table, row_idx, expected_cells
def add_column_fixture(self): snippets = snippet_seq('add-row-col') tbl = parse_xml(snippets[0]) table = Table(tbl, None) width = Inches(1.5) expected_xml = snippets[2] return table, width, expected_xml
def table(self): tbl = _tbl_bldr(rows=2, cols=2).element table = Table(tbl, None) return table
def table_fixture(self): table = Table(None, None) return table
def style_set_fixture(self, request, part_prop_): tbl_cxml, value, style_id, expected_cxml = request.param table = Table(element(tbl_cxml), None) part_prop_.return_value.get_style_id.return_value = style_id expected_xml = xml(expected_cxml) return table, value, expected_xml
def style_get_fixture(self, part_prop_): style_id = 'Barbaz' tbl_cxml = 'w:tbl/w:tblPr/w:tblStyle{w:val=%s}' % style_id table = Table(element(tbl_cxml), None) style_ = part_prop_.return_value.get_style.return_value return table, style_id, style_
def direction_set_fixture(self, request): tbl_cxml, new_value, expected_cxml = request.param table = Table(element(tbl_cxml), None) expected_xml = xml(expected_cxml) return table, new_value, expected_xml
def direction_get_fixture(self, request): tbl_cxml, expected_value = request.param table = Table(element(tbl_cxml), None) return table, expected_value
def column_count_fixture(self): tbl_cxml = 'w:tbl/w:tblGrid/(w:gridCol,w:gridCol,w:gridCol)' expected_value = 3 table = Table(element(tbl_cxml), None) return table, expected_value
def cells_fixture(self, request): snippet_idx, cell_count, unique_count, matches = request.param tbl_xml = snippet_seq('tbl-cells')[snippet_idx] table = Table(parse_xml(tbl_xml), None) return table, cell_count, unique_count, matches
def autofit_get_fixture(self, request): tbl_cxml, expected_autofit = request.param table = Table(element(tbl_cxml), None) return table, expected_autofit
def add_row_fixture(self): snippets = snippet_seq('add-row-col') tbl = parse_xml(snippets[0]) table = Table(tbl, None) expected_xml = snippets[1] return table, expected_xml