示例#1
0
    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_
示例#2
0
    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_
示例#3
0
 def raises_fixture(self, request):
     out_of_range_value = request.param
     stop = _GradientStop(element("a:gs{pos=50000}"))
     return stop, out_of_range_value
示例#4
0
 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
示例#5
0
 def raises_fixture(self, request):
     out_of_range_value = request.param
     stop = _GradientStop(element("a:gs{pos=50000}"))
     return stop, out_of_range_value
示例#6
0
 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