mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
28 lines
808 B
Python
28 lines
808 B
Python
from helper import unittest, PillowTestCase, hopper
|
|
|
|
|
|
class TestImageGetExtrema(PillowTestCase):
|
|
|
|
def test_extrema(self):
|
|
|
|
def extrema(mode):
|
|
return hopper(mode).getextrema()
|
|
|
|
self.assertEqual(extrema("1"), (0, 255))
|
|
self.assertEqual(extrema("L"), (0, 255))
|
|
self.assertEqual(extrema("I"), (0, 255))
|
|
self.assertEqual(extrema("F"), (0, 255))
|
|
self.assertEqual(extrema("P"), (0, 225)) # fixed palette
|
|
self.assertEqual(
|
|
extrema("RGB"), ((0, 255), (0, 255), (0, 255)))
|
|
self.assertEqual(
|
|
extrema("RGBA"), ((0, 255), (0, 255), (0, 255), (255, 255)))
|
|
self.assertEqual(
|
|
extrema("CMYK"), (((0, 255), (0, 255), (0, 255), (0, 0))))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|
|
# End of file
|