def end_y_set_fixture(self, request): xfrm_cxml, new_y, expected_cxml = request.param tmpl = "p:cxnSp/p:spPr/%s" cxnSp = element(tmpl % xfrm_cxml) expected_xml = xml(tmpl % expected_cxml) connector = Connector(cxnSp, None) return connector, new_y, expected_xml
def end_x_get_fixture(self, request): x, cx, flipH, expected_value = request.param cxnSp = element( "p:cxnSp/p:spPr/a:xfrm{flipH=%d}/(a:off{x=%d,y=6},a:ext{cx=%d,cy" "=60})" % (flipH, x, cx)) connector = Connector(cxnSp, None) return connector, expected_value
def end_y_get_fixture(self, request): y, cy, flipV, expected_value = request.param cxnSp = element( "p:cxnSp/p:spPr/a:xfrm{flipV=%d}/(a:off{x=6,y=%d},a:ext{cx=32,cy" "=%d})" % (flipV, y, cy)) connector = Connector(cxnSp, None) return connector, expected_value
def connect_end_fixture(self, request, shape_): cxnSp_cxml, expected_cxml = request.param cxnSp = element(cxnSp_cxml) connector = Connector(cxnSp, None) shape_.shape_id, cxn_idx = 24, 2 expected_xml = xml(expected_cxml) return connector, shape_, cxn_idx, expected_xml
def begin_x_set_fixture(self, request): xfrm_cxml, new_x, expected_cxml = request.param tmpl = 'p:cxnSp/p:spPr/%s' cxnSp = element(tmpl % xfrm_cxml) expected_xml = xml(tmpl % expected_cxml) connector = Connector(cxnSp, None) return connector, new_x, expected_xml
def move_end_fixture(self, request, shape_): cxn_idx, expected_cxml = request.param cxnSp = element("p:cxnSp/p:spPr/a:xfrm/(a:off{x=10,y=15},a:ext{cx=10,cy=5})") connector = Connector(cxnSp, None) shape_.left, shape_.top, shape_.width, shape_.height = 50, 25, 20, 18 expected_xml = xml(expected_cxml) return connector, shape_, cxn_idx, expected_xml
def move_begin_fixture(self, request, shape_): cxn_idx, expected_cxml = request.param cxnSp = element("p:cxnSp/p:spPr/a:xfrm/(a:off{x=66,y=99},a:ext{cx=33,cy=39})") connector = Connector(cxnSp, None) shape_.left, shape_.top, shape_.width, shape_.height = 10, 15, 30, 36 expected_xml = xml(expected_cxml) return connector, shape_, cxn_idx, expected_xml
def it_provides_access_to_its_line_format(self): connector = Connector(element("p:cxnSp/p:spPr"), None) line = connector.line assert isinstance(line, LineFormat) # exercise line to test parent interface, .ln and .get_or_add_ln() line.width = 91440 assert line.width == 91440
def end_conn_fixture(self, _connect_end_to_, _move_end_to_cxn_): connector = Connector(None, None) shape, cxn_idx = 42, 24 return connector, shape, cxn_idx
def it_knows_its_shape_type(self): assert Connector(None, None).shape_type == MSO_SHAPE_TYPE.LINE