Example #1
0
def test_raises_valueerror_when_attempting_darken_with_invalid_type(
        dummy_image: Image, level: int):
    with pytest.raises(ValueError):
        dummy_image.darken(level=level)
Example #2
0
def test_darken_operation_respects_maximum_grayscale(dummy_image: Image):
    p = GrayPixel(100)
    dummy_image.set_pixel(1, 1, p)
    darken_img = dummy_image.darken(200)
    assert not any(val.value > 0 for row in darken_img.values for val in row)