def anchor_get_fixture(self, request): anchor, mso_anchor_idx = request.param tc_bldr = a_tc().with_nsdecls() if anchor is not None: tcPr_bldr = a_tcPr().with_anchor(anchor) tc_bldr.with_child(tcPr_bldr) tc = tc_bldr.element cell = _Cell(tc, None) return cell, mso_anchor_idx
def anchor_set_fixture(self, request): def tc_with_anchor_bldr(anchor): tc_bldr = a_tc().with_nsdecls() if anchor is not None: tcPr_bldr = a_tcPr() if anchor != '': tcPr_bldr.with_anchor(anchor) tc_bldr.with_child(tcPr_bldr) return tc_bldr before_anchor, mso_anchor_idx, after_anchor = request.param tc = tc_with_anchor_bldr(before_anchor).element cell = _Cell(tc, None) tc_with_anchor_xml = tc_with_anchor_bldr(after_anchor).xml() return cell, mso_anchor_idx, tc_with_anchor_xml
def margin_get_fixture(self, request): mar_vals, expected_vals = request.param marL, marR, marT, marB = mar_vals margin_left, margin_right, margin_top, margin_bottom = expected_vals tcPr_bldr = a_tcPr() if marL is not None: tcPr_bldr.with_marL(marL) if marR is not None: tcPr_bldr.with_marR(marR) if marT is not None: tcPr_bldr.with_marT(marT) if marB is not None: tcPr_bldr.with_marB(marB) tc = a_tc().with_nsdecls().with_child(tcPr_bldr).element cell = _Cell(tc, None) return cell, margin_left, margin_right, margin_top, margin_bottom
def margin_set_fixture(self, request): def tc_bldr_with(marX): marL, marR, marT, marB = marX tcPr_bldr = a_tcPr() if marL is not None: tcPr_bldr.with_marL(marL) if marR is not None: tcPr_bldr.with_marR(marR) if marT is not None: tcPr_bldr.with_marT(marT) if marB is not None: tcPr_bldr.with_marB(marB) return a_tc().with_nsdecls().with_child(tcPr_bldr) before_vals, after_vals = request.param tc = tc_bldr_with(before_vals).element cell = _Cell(tc, None) marL, marR, marT, marB = after_vals tc_with_marX_xml = tc_bldr_with(after_vals).xml() return cell, marL, marR, marT, marB, tc_with_marX_xml
def cell(self): return _Cell(element('a:tc'), None)
def text_set_fixture(self, request): tc_cxml, new_text, expected_cxml = request.param cell = _Cell(element(tc_cxml), None) expected_xml = xml(expected_cxml) return cell, new_text, expected_xml
def margin_raises_fixture(self, request): margin_prop_name = request.param cell = _Cell(element('a:tc'), None) val_of_invalid_type = 'foobar' return cell, margin_prop_name, val_of_invalid_type
def margin_set_fixture(self, request): tc_cxml, margin_prop_name, new_value, expected_tc_cxml = request.param cell = _Cell(element(tc_cxml), None) expected_xml = xml(expected_tc_cxml) return cell, margin_prop_name, new_value, expected_xml
def margin_get_fixture(self, request): tc_cxml, margin_prop_name, expected_value = request.param cell = _Cell(element(tc_cxml), None) return cell, margin_prop_name, expected_value
def anchor_set_fixture(self, request): tc_cxml, new_value, expected_tc_cxml = request.param cell = _Cell(element(tc_cxml), None) expected_xml = xml(expected_tc_cxml) return cell, new_value, expected_xml
def cell(self): tc = a_tc().with_nsdecls().element return _Cell(tc, None)
def cell(self): return _Cell(test_table_elements.cell, None)
def anchor_get_fixture(self, request): tc_cxml, expected_value = request.param cell = _Cell(element(tc_cxml), None) return cell, expected_value