From 3d185ee8579d6cab7660d19cbcad66609c8c19c9 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Fri, 30 Dec 2016 22:31:35 +0000 Subject: [PATCH] added tests for sgi writing --- Tests/test_file_sgi.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/test_file_sgi.py b/Tests/test_file_sgi.py index af40ac848..65910b5eb 100644 --- a/Tests/test_file_sgi.py +++ b/Tests/test_file_sgi.py @@ -45,6 +45,17 @@ class TestFileSgi(PillowTestCase): lambda: SgiImagePlugin.SgiImageFile(invalid_file)) + def test_write(self): + def roundtrip(img): + out = self.tempfile('temp.sgi') + img.save(out, format='sgi') + reloaded = Image.open(out) + self.assert_image_equal(img, reloaded) + + for mode in ('L', 'RGB', 'RGBA'): + roundtrip(hopper(mode)) + + if __name__ == '__main__': unittest.main()