mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Added test for pathlib
This commit is contained in:
parent
457d39832d
commit
cf4145e2c9
|
@ -1,6 +1,7 @@
|
||||||
from helper import unittest, PillowTestCase, hopper
|
from helper import unittest, PillowTestCase, hopper
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
class TestImage(PillowTestCase):
|
class TestImage(PillowTestCase):
|
||||||
|
@ -48,6 +49,14 @@ class TestImage(PillowTestCase):
|
||||||
im = io.BytesIO(b'')
|
im = io.BytesIO(b'')
|
||||||
self.assertRaises(IOError, lambda: Image.open(im))
|
self.assertRaises(IOError, lambda: Image.open(im))
|
||||||
|
|
||||||
|
@unittest.skipIf(sys.version_info < (3, 4),
|
||||||
|
"pathlib only available in Python 3.4 or later")
|
||||||
|
def test_pathlib(self):
|
||||||
|
from pathlib import Path
|
||||||
|
im = Image.open(Path("Tests/images/hopper.jpg"))
|
||||||
|
self.assertEqual(im.mode, "RGB")
|
||||||
|
self.assertEqual(im.size, (128, 128))
|
||||||
|
|
||||||
def test_internals(self):
|
def test_internals(self):
|
||||||
|
|
||||||
im = Image.new("L", (100, 100))
|
im = Image.new("L", (100, 100))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user