mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-03 12:43:05 +03:00
commit
94925c5057
|
@ -23,20 +23,20 @@ class TestFeatures(PillowTestCase):
|
||||||
self.assertEqual(features.check_feature(feature),
|
self.assertEqual(features.check_feature(feature),
|
||||||
features.check(feature))
|
features.check(feature))
|
||||||
|
|
||||||
@unittest.skipUnless(HAVE_WEBP, True)
|
@unittest.skipUnless(HAVE_WEBP, "WebP not available")
|
||||||
def check_webp_transparency(self):
|
def test_webp_transparency(self):
|
||||||
self.assertEqual(features.check('transp_webp'),
|
self.assertEqual(features.check('transp_webp'),
|
||||||
not _webp.WebPDecoderBuggyAlpha())
|
not _webp.WebPDecoderBuggyAlpha())
|
||||||
self.assertEqual(features.check('transp_webp'),
|
self.assertEqual(features.check('transp_webp'),
|
||||||
_webp.HAVE_TRANSPARENCY)
|
_webp.HAVE_TRANSPARENCY)
|
||||||
|
|
||||||
@unittest.skipUnless(HAVE_WEBP, True)
|
@unittest.skipUnless(HAVE_WEBP, "WebP not available")
|
||||||
def check_webp_mux(self):
|
def test_webp_mux(self):
|
||||||
self.assertEqual(features.check('webp_mux'),
|
self.assertEqual(features.check('webp_mux'),
|
||||||
_webp.HAVE_WEBPMUX)
|
_webp.HAVE_WEBPMUX)
|
||||||
|
|
||||||
@unittest.skipUnless(HAVE_WEBP, True)
|
@unittest.skipUnless(HAVE_WEBP, "WebP not available")
|
||||||
def check_webp_anim(self):
|
def test_webp_anim(self):
|
||||||
self.assertEqual(features.check('webp_anim'),
|
self.assertEqual(features.check('webp_anim'),
|
||||||
_webp.HAVE_WEBPANIM)
|
_webp.HAVE_WEBPANIM)
|
||||||
|
|
||||||
|
|
|
@ -13,15 +13,11 @@ class TestFormatHSV(PillowTestCase):
|
||||||
return float(i)/255.0
|
return float(i)/255.0
|
||||||
|
|
||||||
def str_to_float(self, i):
|
def str_to_float(self, i):
|
||||||
|
|
||||||
return float(ord(i))/255.0
|
return float(ord(i))/255.0
|
||||||
|
|
||||||
def to_int(self, f):
|
|
||||||
return int(f*255.0)
|
|
||||||
|
|
||||||
def tuple_to_ints(self, tp):
|
def tuple_to_ints(self, tp):
|
||||||
x, y, z = tp
|
x, y, z = tp
|
||||||
return (int(x*255.0), int(y*255.0), int(z*255.0))
|
return int(x*255.0), int(y*255.0), int(z*255.0)
|
||||||
|
|
||||||
def test_sanity(self):
|
def test_sanity(self):
|
||||||
Image.new('HSV', (100, 100))
|
Image.new('HSV', (100, 100))
|
||||||
|
|
|
@ -5,19 +5,12 @@ from PIL import __version__
|
||||||
try:
|
try:
|
||||||
import pyroma
|
import pyroma
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# Skip via setUp()
|
pyroma = None
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class TestPyroma(PillowTestCase):
|
class TestPyroma(PillowTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
@unittest.skipUnless(pyroma, "Pyroma is not installed")
|
||||||
try:
|
|
||||||
import pyroma
|
|
||||||
assert pyroma # Ignore warning
|
|
||||||
except ImportError:
|
|
||||||
self.skipTest("ImportError")
|
|
||||||
|
|
||||||
def test_pyroma(self):
|
def test_pyroma(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
data = pyroma.projectdata.get_data(".")
|
data = pyroma.projectdata.get_data(".")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user