8000 Incorporate review · libvips/pyvips@cb6b0b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit cb6b0b7

Browse files
committed
Incorporate review
1 parent 1af1e16 commit cb6b0b7

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

pyvips/tests/test_arithmetic.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -548,17 +548,18 @@ def test_measure(self):
548548
self.assertAlmostEqual(p2, 10)
549549

550550
def test_find_trim(self):
551-
im = pyvips.Image.black(50, 60) + 100
552-
test = im.embed(10, 20, 200, 300, extend = "white")
551+
if pyvips.type_find("VipsOperation", "find_trim") != 0:
552+
im = pyvips.Image.black(50, 60) + 100
553+
test = im.embed(10, 20, 200, 300, extend = "white")
553554

554-
for x in unsigned_formats + float_formats:
555-
a = test.cast(x)
556-
left, top, width, height = a.find_trim()
555+
for x in unsigned_formats + float_formats:
556+
a = test.cast(x)
557+
left, top, width, height = a.find_trim()
557558

558-
self.assertEqual(left, 10)
559-
self.assertEqual(top, 20)
560-
self.assertEqual(width, 50)
561-
self.assertEqual(height, 60)
559+
self.assertEqual(left, 10)
560+
self.assertEqual(top, 20)
561+
self.assertEqual(width, 50)
562+
self.assertEqual(height, 60)
562563

563564
def test_profile(self):
564565
test = pyvips.Image.black(100, 100).draw_rect(100, 40, 50, 1, 1)

pyvips/tests/test_create.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,14 @@ def test_sines(self):
375375
self.assertEqual(im.format, pyvips.BandFormat.FLOAT)
376376

377377
def test_text(self):
378-
im = pyvips.Image.text("Hello, world!")
379-
self.assertTrue(im.width > 10)
380-
self.assertTrue(im.height > 10)
381-
self.assertEqual(im.bands, 1)
382-
self.assertEqual(im.format, pyvips.BandFormat.UCHAR)
383-
self.assertEqual(im.max(), 255)
384-
self.assertEqual(im.min(), 0)
378+
if pyvips.type_find("VipsOperation", "text") != 0:
379+
im = pyvips.Image.text("Hello, world!")
380+
self.assertTrue(im.width > 10)
381+
self.assertTrue(im.height > 10)
382+
self.assertEqual(im.bands, 1)
383+
self.assertEqual(im.format, pyvips.BandFormat.UCHAR)
384+
self.assertEqual(im.max(), 255)
385+
self.assertEqual(im.min(), 0)
385386

386387
def test_tonelut(self):
387388
im = pyvips.Image.tonelut()

0 commit comments

Comments
 (0)
0