From f131aaa0821beea222cc2d90ffea4b77ba42ac90 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 13 Feb 2016 14:27:41 +0000 Subject: [PATCH] fix up magickload test again --- test/test_foreign.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test_foreign.py b/test/test_foreign.py index d1467c4a..9722e184 100755 --- a/test/test_foreign.py +++ b/test/test_foreign.py @@ -231,14 +231,16 @@ class TestForeign(unittest.TestCase): def gif_valid(self, im): a = im(10, 10) - # some libMagick produce an RGB for this image, some a mono - if len(a) > 1: + # some libMagick produce an RGB for this image, some a mono, some + # rgba :-( + if len(a) == 4: + self.assertAlmostEqual(a, [33, 33, 33, 255]) + elif len(a) == 3: self.assertAlmostEqual(a, [33, 33, 33]) - self.assertEqual(im.bands, 3) else: self.assertAlmostEqual(a, [33]) - self.assertEqual(im.bands, 1) + self.assertEqual(im.bands, len(a)) self.assertEqual(im.width, 159) self.assertEqual(im.height, 203)