Test positive and zero kmeans

This commit is contained in:
Andrew Murray 2024-03-22 23:53:07 +11:00
parent 171e497e05
commit 47040c7b35

View File

@ -99,6 +99,10 @@ def test_quantize_dither_diff() -> None:
) )
def test_quantize_kmeans(method) -> None: def test_quantize_kmeans(method) -> None:
im = hopper() im = hopper()
no_kmeans = im.quantize(kmeans=0, method=method)
kmeans = im.quantize(kmeans=1, method=method)
assert kmeans.tobytes() != no_kmeans.tobytes()
with pytest.raises(ValueError): with pytest.raises(ValueError):
im.quantize(kmeans=-1, method=method) im.quantize(kmeans=-1, method=method)