From 761081b1e32d995cdab6667c1dc1ba99b526948d Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 28 May 2017 22:56:25 +0300 Subject: [PATCH] Test mirroring --- Tests/test_imagemorph.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tests/test_imagemorph.py b/Tests/test_imagemorph.py index f2247bdca..c0f6448e6 100644 --- a/Tests/test_imagemorph.py +++ b/Tests/test_imagemorph.py @@ -176,6 +176,24 @@ class MorphTests(PillowTestCase): self.assertEqual(len(coords), 4) self.assertEqual(tuple(coords), ((2, 2), (4, 2), (2, 4), (4, 4))) + def test_mirroring(self): + # Test 'M' for mirroring + mop = ImageMorph.MorphOp(patterns=['1:(... ... ...)->0', + 'M:(00. 01. ...)->1']) + count, Aout = mop.apply(self.A) + self.assertEqual(count, 7) + self.assert_img_equal_img_string(Aout, + """ + + ....... + ....... + ..1.1.. + ....... + ....... + ....... + ....... + """) + def test_non_binary_images(self): im = hopper('RGB') mop = ImageMorph.MorphOp(op_name="erosion8")