mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
25 lines
759 B
Python
25 lines
759 B
Python
from helper import unittest, PillowTestCase, hopper
|
|
|
|
|
|
class TestImageGetPalette(PillowTestCase):
|
|
|
|
def test_palette(self):
|
|
def palette(mode):
|
|
p = hopper(mode).getpalette()
|
|
if p:
|
|
return p[:10]
|
|
return None
|
|
self.assertEqual(palette("1"), None)
|
|
self.assertEqual(palette("L"), None)
|
|
self.assertEqual(palette("I"), None)
|
|
self.assertEqual(palette("F"), None)
|
|
self.assertEqual(palette("P"), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
|
|
self.assertEqual(palette("RGB"), None)
|
|
self.assertEqual(palette("RGBA"), None)
|
|
self.assertEqual(palette("CMYK"), None)
|
|
self.assertEqual(palette("YCbCr"), None)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|