@@ -34,19 +34,11 @@ def it_can_add_a_trPr(self, tr_cxml: str, expected_cxml: str):
34
34
tr ._add_trPr ()
35
35
assert tr .xml == xml (expected_cxml )
36
36
37
- @pytest .mark .parametrize (
38
- ("snippet_idx" , "row_idx" , "col_idx" , "err_msg" ),
39
- [
40
- (0 , 0 , 3 , "index out of bounds" ),
41
- (1 , 0 , 1 , "no cell on grid column 1" ),
42
- ],
43
- )
44
- def it_raises_on_tc_at_grid_col (
45
- self , snippet_idx : int , row_idx : int , col_idx : int , err_msg : str
46
- ):
37
+ @pytest .mark .parametrize (("snippet_idx" , "row_idx" , "col_idx" ), [(0 , 0 , 3 ), (1 , 0 , 1 )])
38
+ def it_raises_on_tc_at_grid_col (self , snippet_idx : int , row_idx : int , col_idx : int ):
47
39
tr = cast (CT_Tbl , parse_xml (snippet_seq ("tbl-cells" )[snippet_idx ])).tr_lst [row_idx ]
48
- with pytest .raises (ValueError , match = err_msg ):
49
- tr .tc_at_grid_col (col_idx )
40
+ with pytest .raises (ValueError , match = f"no `tc` element at grid_offset= { col_idx } " ):
41
+ tr .
6D4E
tc_at_grid_offset (col_idx )
50
42
51
43
52
44
class DescribeCT_Tc :
@@ -76,12 +68,12 @@ def it_can_merge_to_another_tc(
76
68
top , left , height , width = 0 , 1 , 2 , 3
77
69
_span_dimensions_ .return_value = top , left , height , width
78
70
_tbl_ .return_value .tr_lst = [tr_ ]
79
- tr_ .tc_at_grid_col .return_value = top_tc_
71
+ tr_ .tc_at_grid_offset .return_value = top_tc_
80
72
81
73
merged_tc = tc .merge (other_tc )
82
74
83
75
_span_dimensions_ .assert_called_once_with (tc , other_tc )
84
- top_tr_ .tc_at_grid_col .assert_called_once_with (left )
76
+ top_tr_ .tc_at_grid_offset .assert_called_once_with (left )
85
77
top_tc_ ._grow_to .assert_called_once_with (width , height )
86
78
assert merged_tc is top_tc_
87
79
0 commit comments