Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 def table(self):
     tbl = _tbl_bldr(rows=2, cols=2).element
     table = Table(tbl, None)
     return table
Пример #5
0
 def table_fixture(self):
     table = Table(None, None)
     return table
Пример #6
0
 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
Пример #7
0
 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_
Пример #8
0
 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
Пример #9
0
 def direction_get_fixture(self, request):
     tbl_cxml, expected_value = request.param
     table = Table(element(tbl_cxml), None)
     return table, expected_value
Пример #10
0
 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
Пример #11
0
 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
Пример #12
0
 def autofit_get_fixture(self, request):
     tbl_cxml, expected_autofit = request.param
     table = Table(element(tbl_cxml), None)
     return table, expected_autofit
Пример #13
0
 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