|
21 | 21 |
|
22 | 22 | class DescribeCT_Row(object): |
23 | 23 |
|
| 24 | + def it_can_add_a_trPr(self, add_trPr_fixture): |
| 25 | + tr, expected_xml = add_trPr_fixture |
| 26 | + tr._add_trPr() |
| 27 | + assert tr.xml == expected_xml |
| 28 | + |
24 | 29 | def it_raises_on_tc_at_grid_col(self, tc_raise_fixture): |
25 | 30 | tr, idx = tc_raise_fixture |
26 | 31 | with pytest.raises(ValueError): |
27 | 32 | tr.tc_at_grid_col(idx) |
28 | 33 |
|
29 | 34 | # fixtures ------------------------------------------------------- |
30 | 35 |
|
| 36 | + @pytest.fixture(params=[ |
| 37 | + ('w:tr', 'w:tr/w:trPr'), |
| 38 | + ('w:tr/w:tblPrEx', 'w:tr/(w:tblPrEx,w:trPr)'), |
| 39 | + ('w:tr/w:tc', 'w:tr/(w:trPr,w:tc)'), |
| 40 | + ('w:tr/(w:sdt,w:del,w:tc)', 'w:tr/(w:trPr,w:sdt,w:del,w:tc)'), |
| 41 | + ]) |
| 42 | + def add_trPr_fixture(self, request): |
| 43 | + tr_cxml, expected_cxml = request.param |
| 44 | + tr = element(tr_cxml) |
| 45 | + expected_xml = xml(expected_cxml) |
| 46 | + return tr, expected_xml |
| 47 | + |
31 | 48 | @pytest.fixture(params=[(0, 0, 3), (1, 0, 1)]) |
32 | 49 | def tc_raise_fixture(self, request): |
33 | 50 | snippet_idx, row_idx, col_idx = request.param |
|
0 commit comments