mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 08:12:33 +03:00
Refactor and test matrix convert with RGB and L modes
This commit is contained in:
parent
cea36587ab
commit
90dac5f4dc
|
@ -150,7 +150,9 @@ class TestImageConvert(PillowTestCase):
|
|||
self.assertRaises(ValueError,
|
||||
lambda: im.convert(mode='CMYK', matrix=matrix))
|
||||
|
||||
def test_matrix(self):
|
||||
def test_matrix_rgb(self):
|
||||
|
||||
def matrix_convert(mode):
|
||||
# Arrange
|
||||
im = hopper('RGB')
|
||||
matrix = (
|
||||
|
@ -161,12 +163,14 @@ class TestImageConvert(PillowTestCase):
|
|||
|
||||
# Act
|
||||
# Convert an RGB image to the CIE XYZ colour space
|
||||
converted_im = im.convert(mode='RGB', matrix=matrix)
|
||||
converted_im = im.convert(mode=mode, matrix=matrix)
|
||||
|
||||
# Assert
|
||||
self.assertEqual(converted_im.mode, 'RGB')
|
||||
self.assertEqual(converted_im.mode, mode)
|
||||
self.assertEqual(converted_im.size, im.size)
|
||||
|
||||
matrix_convert('RGB')
|
||||
matrix_convert('L')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue
Block a user