From 279c1ef55f4813892f1fc45417d7e9f06d5fcf40 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 11 Aug 2017 09:31:01 +0100 Subject: [PATCH] make test text pass if text is missing --- test/test_create.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test_create.py b/test/test_create.py index 9641efa8..97d178f1 100755 --- a/test/test_create.py +++ b/test/test_create.py @@ -409,13 +409,15 @@ class TestCreate(unittest.TestCase): self.assertEqual(im.format, Vips.BandFormat.FLOAT) def test_text(self): - im = Vips.Image.text("Hello, world!") - self.assertTrue(im.width > 10) - self.assertTrue(im.height > 10) - self.assertEqual(im.bands, 1) - self.assertEqual(im.format, Vips.BandFormat.UCHAR) - self.assertEqual(im.max(), 255) - self.assertEqual(im.min(), 0) + x = Vips.type_find("VipsOperation", "text") + if x.is_instantiatable(): + im = Vips.Image.text("Hello, world!") + self.assertTrue(im.width > 10) + self.assertTrue(im.height > 10) + self.assertEqual(im.bands, 1) + self.assertEqual(im.format, Vips.BandFormat.UCHAR) + self.assertEqual(im.max(), 255) + self.assertEqual(im.min(), 0) def test_tonelut(self): im = Vips.Image.tonelut()