def it_provides_access_to_its_color(self, request): gs = element("a:gs") ColorFormat_ = class_mock(request, "pptx.dml.fill.ColorFormat") color_ = instance_mock(request, ColorFormat) ColorFormat_.from_colorchoice_parent.return_value = color_ stop = _GradientStop(gs) color = stop.color ColorFormat_.from_colorchoice_parent.assert_called_once_with(gs) assert color is color_
def raises_fixture(self, request): out_of_range_value = request.param stop = _GradientStop(element("a:gs{pos=50000}")) return stop, out_of_range_value
def pos_set_fixture(self, request): gs_cxml, new_value, expected_value = request.param stop = _GradientStop(element(gs_cxml)) return stop, new_value, expected_value