Skip to content

Commit

Permalink
Test matrix convert for ValueError: image has wrong mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 29, 2017
1 parent 90dac5f commit fdf0737
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/test_image_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,19 @@ def test_matrix_illegal_conversion(self):
self.assertRaises(ValueError,
lambda: im.convert(mode='CMYK', matrix=matrix))

def test_matrix_wrong_mode(self):
# Arrange
im = hopper('L')
matrix = (
0.412453, 0.357580, 0.180423, 0,
0.212671, 0.715160, 0.072169, 0,
0.019334, 0.119193, 0.950227, 0)
self.assertEqual(im.mode, 'L')

# Act / Assert
self.assertRaises(ValueError,
lambda: im.convert(mode='L', matrix=matrix))

def test_matrix_rgb(self):

def matrix_convert(mode):
Expand Down

0 comments on commit fdf0737

Please sign in to comment.