diff --git a/Tests/test_image_histogram.py b/Tests/test_image_histogram.py index 7ab4a8d6419..826814f3091 100644 --- a/Tests/test_image_histogram.py +++ b/Tests/test_image_histogram.py @@ -10,26 +10,26 @@ from .helper import hopper expected_data = { - "1": (256, 0, 10994, b"zk4Al^)(jtioYSyJT@emR4*b*%R1K"), - "CMYK": (1024, 0, 16384, b"zqm8<<;r>h42v|$3xNIR#fG2=P&z(awe2&{GK(8o"), - "F": (256, 0, 662, b"*EIrB8n_NEx9e()#ao<>L)@gEjm|N%I8B)YhA8V~"), - "HSV": (768, 0, 1696, b"F6vt%@sQf%X04Md4^n!Qpv!qJ8Oz()CqPx=rjFvu"), - "I": (256, 0, 662, b"*EIrB8n_NEx9e()#ao<>L)@gEjm|N%I8B)YhA8V~"), - "I;16": (256, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), - "I;16B": (256, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), - "I;16L": (256, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), - "I;16N": (256, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), - "L": (256, 0, 662, b"EmZC)FNJ#AK=O?2(qxYeY#*-vk97Iz%f8!~q"), - "RGB": (768, 4, 675, b"!TjBr^o$}ZXlfh|aIU7&4VKP8=rBq&RecVDIcndZ"), - "RGBA": (1024, 0, 16384, b"du`JBXvzDrPu^Ybc}8Y+4y1MDTEK|!Q|rR~Jk^@J"), - "RGBa": (1024, 0, 16384, b"du`JBXvzDrPu^Ybc}8Y+4y1MDTEK|!Q|rR~Jk^@J"), - "RGBX": (1024, 0, 16384, b"du`JBXvzDrPu^Ybc}8Y+4y1MDTEK|!Q|rR~Jk^@J"), - "YCbCr": (768, 0, 1908, b"%z+JjEuI^YFOt*}($tSuSk^nX-~-HI>QDL>T%9H9"), + "1": (256, 16384, 0, 10994, b"zk4Al^)(jtioYSyJT@emR4*b*%R1K"), + "CMYK": (1024, 65536, 0, 16384, b"zqm8<<;r>h42v|$3xNIR#fG2=P&z(awe2&{GK(8o"), + "F": (256, 16384, 0, 662, b"*EIrB8n_NEx9e()#ao<>L)@gEjm|N%I8B)YhA8V~"), + "HSV": (768, 49152, 0, 1696, b"F6vt%@sQf%X04Md4^n!Qpv!qJ8Oz()CqPx=rjFvu"), + "I": (256, 16384, 0, 662, b"*EIrB8n_NEx9e()#ao<>L)@gEjm|N%I8B)YhA8V~"), + "I;16": (256, 16384, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), + "I;16B": (256, 16384, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), + "I;16L": (256, 16384, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), + "I;16N": (256, 16384, 0, 8192, b"S+c=3i+Fs3wK2>Q<8rq@PgsAg=nE1VLdMtHZ2K8$"), + "L": (256, 16384, 0, 662, b"EmZC)FNJ#AK=O?2(qxYeY#*-vk97Iz%f8!~q"), + "RGB": (768, 49152, 4, 675, b"!TjBr^o$}ZXlfh|aIU7&4VKP8=rBq&RecVDIcndZ"), + "RGBA": (1024, 65536, 0, 16384, b"du`JBXvzDrPu^Ybc}8Y+4y1MDTEK|!Q|rR~Jk^@J"), + "RGBa": (1024, 65536, 0, 16384, b"du`JBXvzDrPu^Ybc}8Y+4y1MDTEK|!Q|rR~Jk^@J"), + "RGBX": (1024, 65536, 0, 16384, b"du`JBXvzDrPu^Ybc}8Y+4y1MDTEK|!Q|rR~Jk^@J"), + "YCbCr": (768, 49152, 0, 1908, b"%z+JjEuI^YFOt*}($tSuSk^nX-~-HI>QDL>T%9H9"), } @@ -43,5 +43,5 @@ def deterministic_hash(data: list[int]) -> bytes: @pytest.mark.parametrize("mode", Image.MODES) def test_histogram(mode: str) -> None: h = hopper(mode).histogram() - data = (len(h), min(h), max(h), deterministic_hash(h)) + data = (len(h), sum(h), min(h), max(h), deterministic_hash(h)) assert data == expected_data[mode]