|
9 | 9 | import pytest |
10 | 10 |
|
11 | 11 | from docx.table import ( |
12 | | - _Cell, _CellCollection, _Column, _Row, _RowCollection, Table |
| 12 | + _Cell, _CellCollection, _Column, _ColumnCollection, _Row, _RowCollection, |
| 13 | + Table |
13 | 14 | ) |
14 | 15 |
|
15 | 16 | from .oxml.unitdata.table import a_gridCol, a_tbl, a_tblGrid, a_tc, a_tr |
|
18 | 19 |
|
19 | 20 | class DescribeTable(object): |
20 | 21 |
|
21 | | - def it_provides_access_to_the_table_rows(self, row_access_fixture): |
22 | | - table = row_access_fixture |
| 22 | + def it_provides_access_to_the_table_rows(self, table): |
23 | 23 | rows = table.rows |
24 | 24 | assert isinstance(rows, _RowCollection) |
25 | 25 |
|
| 26 | + def it_provides_access_to_the_table_columns(self, table): |
| 27 | + columns = table.columns |
| 28 | + assert isinstance(columns, _ColumnCollection) |
| 29 | + |
26 | 30 | def it_can_add_a_column(self, add_column_fixture): |
27 | 31 | table, expected_xml = add_column_fixture |
28 | 32 | col = table.add_column() |
@@ -52,7 +56,7 @@ def add_row_fixture(self): |
52 | 56 | return table, expected_xml |
53 | 57 |
|
54 | 58 | @pytest.fixture |
55 | | - def row_access_fixture(self): |
| 59 | + def table(self): |
56 | 60 | tbl = _tbl_bldr(rows=2, cols=2).element |
57 | 61 | table = Table(tbl) |
58 | 62 | return table |
|
0 commit comments