def it_raises_on_non_linear_gradient(self): gradFill = element("a:gradFill/a:path") grad_fill = _GradFill(gradFill) with pytest.raises(ValueError): grad_fill.gradient_angle with pytest.raises(ValueError): grad_fill.gradient_angle = 43.21
def stops_fixture(self, request, _GradientStops_, gradient_stops_): gradFill_cxml, expected_cxml, add_gsLst = request.param _GradientStops_.return_value = gradient_stops_ grad_fill = _GradFill(element(gradFill_cxml)) if add_gsLst: expected_xml = xml( expected_cxml + "/a:gsLst/(a:gs{pos=0}/a:schemeClr{val=accen" "t1}/(a:tint{val=100000},a:shade{val=100000},a:satMod{val=13" "0000}),a:gs{pos=100000}/a:schemeClr{val=accent1}/(a:tint{va" "l=50000},a:shade{val=100000},a:satMod{val=350000}))") else: expected_xml = xml(expected_cxml) return grad_fill, _GradientStops_, expected_xml, gradient_stops_
def stops_fixture(self, request, _GradientStops_, gradient_stops_): gradFill_cxml, expected_cxml, add_gsLst = request.param _GradientStops_.return_value = gradient_stops_ grad_fill = _GradFill(element(gradFill_cxml)) if add_gsLst: expected_xml = xml( expected_cxml + "/a:gsLst/(a:gs{pos=0}/a:schemeClr{val=accen" "t1}/(a:tint{val=100000},a:shade{val=100000},a:satMod{val=13" "0000}),a:gs{pos=100000}/a:schemeClr{val=accent1}/(a:tint{va" "l=50000},a:shade{val=100000},a:satMod{val=350000}))" ) else: expected_xml = xml(expected_cxml) return grad_fill, _GradientStops_, expected_xml, gradient_stops_
def fill_type_fixture(self): xFill = element('a:gradFill') grad_fill = _GradFill(xFill) expected_value = MSO_FILL.GRADIENT return grad_fill, expected_value
def angle_set_fixture(self, request): angle, expected_cxml = request.param grad_fill = _GradFill(element("a:gradFill/a:lin{ang=0}")) expected_xml = xml(expected_cxml) return grad_fill, angle, expected_xml
def angle_fixture(self, request): cxml, expected_value = request.param grad_fill = _GradFill(element(cxml)) return grad_fill, expected_value
def fill_type_fixture(self): xFill = element("a:gradFill") grad_fill = _GradFill(xFill) expected_value = MSO_FILL.GRADIENT return grad_fill, expected_value