@@ -380,6 +380,10 @@ def it_provides_access_to_its_cells(self, cells_fixture):
380380 column .table .column_cells .assert_called_once_with (column_idx )
381381 assert cells == expected_cells
382382
383+ def it_provides_access_to_the_table_it_belongs_to (self , table_fixture ):
384+ column , table_ = table_fixture
385+ assert column .table is table_
386+
383387 def it_knows_its_width_in_EMU (self , width_get_fixture ):
384388 column , expected_width = width_get_fixture
385389 assert column .width == expected_width
@@ -400,6 +404,12 @@ def cells_fixture(self, _index_, table_prop_, table_):
400404 table_ .column_cells .return_value = list (expected_cells )
401405 return column , column_idx , expected_cells
402406
407+ @pytest .fixture
408+ def table_fixture (self , parent_ , table_ ):
409+ column = _Column (None , None , parent_ )
410+ parent_ .table = table_
411+ return column , table_
412+
403413 @pytest .fixture (params = [
404414 ('w:gridCol{w:w=4242}' , 2693670 ),
405415 ('w:gridCol{w:w=1440}' , 914400 ),
@@ -431,6 +441,10 @@ def width_set_fixture(self, request):
431441 def _index_ (self , request ):
432442 return property_mock (request , _Column , '_index' )
433443
444+ @pytest .fixture
445+ def parent_ (self , request ):
446+ return instance_mock (request , Table )
447+
434448 @pytest .fixture
435449 def table_ (self , request ):
436450 return instance_mock (request , Table )
0 commit comments