From 47040c7b35b1fa616035a26784ebb2fc1abef343 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 22 Mar 2024 23:53:07 +1100 Subject: [PATCH] Test positive and zero kmeans --- Tests/test_image_quantize.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/test_image_quantize.py b/Tests/test_image_quantize.py index da736d6ed..e1aa6252b 100644 --- a/Tests/test_image_quantize.py +++ b/Tests/test_image_quantize.py @@ -99,6 +99,10 @@ def test_quantize_dither_diff() -> None: ) def test_quantize_kmeans(method) -> None: 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): im.quantize(kmeans=-1, method=method)