def is_placeholder_fixture(self, request, shape_elm_, txBody_): is_placeholder = request.param shape_elm_.has_ph_elm = is_placeholder shape = BaseShape(shape_elm_, None) return shape, is_placeholder
def dimensions_set_fixture(self, request, width, height): start_elm_fixt_name, expected_elm_fixt_name = request.param start_elm = request.getfuncargvalue(start_elm_fixt_name) shape = BaseShape(start_elm, None) expected_xml = request.getfuncargvalue(expected_elm_fixt_name).xml return shape, width, height, expected_xml
def id_fixture(self, request): xSp_cxml, expected_value = request.param shape = BaseShape(element(xSp_cxml), None) return shape, expected_value
def it_knows_it_doesnt_contain_a_table(self): shape = BaseShape(None, None) assert shape.has_table is False
def click_action_fixture(self, request, ActionSetting_, action_setting_): sp_cxml = request.param sp = element(sp_cxml) cNvPr = sp.xpath('//p:cNvPr')[0] shape = BaseShape(sp, None) return shape, ActionSetting_, cNvPr, action_setting_
def it_knows_it_doesnt_have_a_text_frame(self): shape = BaseShape(None, None) assert shape.has_text_frame is False
def it_knows_it_doesnt_contain_a_chart(self): shape = BaseShape(None, None) assert shape.has_chart is False
def position_set_fixture(self, request, left, top): start_elm_fixt_name, expected_elm_fixt_name = request.param start_elm = request.getfuncargvalue(start_elm_fixt_name) shape = BaseShape(start_elm, None) expected_xml = request.getfuncargvalue(expected_elm_fixt_name).xml return shape, left, top, expected_xml
def phfmt_raise_fixture(self): return BaseShape(element('p:sp/p:nvSpPr/p:nvPr'), None)
def phfmt_fixture(self, _PlaceholderFormat_, placeholder_format_): sp = element('p:sp/p:nvSpPr/p:nvPr/p:ph') ph = sp.xpath('//p:ph')[0] shape = BaseShape(sp, None) return shape, _PlaceholderFormat_, placeholder_format_, ph
def part_fixture(self, shapes_): parent_ = shapes_ shape = BaseShape(None, parent_) return shape, parent_
def name_get_fixture(self, shape_name): shape_elm = (an_sp().with_nsdecls().with_child(an_nvSpPr().with_child( a_cNvPr().with_name(shape_name)))).element shape = BaseShape(shape_elm, None) return shape, shape_name