def test_invalid_stop_color_mix(self, Stop): from ..fills import _assign_position with pytest.raises(ValueError): _assign_position([Stop(BLACK, .1), WHITE])
def test_position_invalid(self, Stop, position, exception): with pytest.raises(exception): Stop('999999', position)
def test_stop_sequence(self, GradientFill, Stop, colors): gf = GradientFill(stop=[Stop(colors[0], 0), Stop(colors[1], .5)]) assert gf.stop[0].color.rgb == BLACK assert gf.stop[1].color.rgb == WHITE assert gf.stop[0].position == 0 assert gf.stop[1].position == .5
def test_position_valid(self, Stop, position): # smoke test Stop('999999', position)