mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Added .pnm test
This commit is contained in:
parent
8f34621c14
commit
873603701f
BIN
Tests/images/hopper.pnm
Normal file
BIN
Tests/images/hopper.pnm
Normal file
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
from .helper import PillowTestCase
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
@ -34,6 +34,16 @@ class TestFilePpm(PillowTestCase):
|
|||
reloaded = Image.open(f)
|
||||
self.assert_image_equal(im, reloaded)
|
||||
|
||||
def test_pnm(self):
|
||||
im = Image.open('Tests/images/hopper.pnm')
|
||||
self.assert_image_similar(im, hopper(), 0.0001)
|
||||
|
||||
f = self.tempfile('temp.pnm')
|
||||
im.save(f)
|
||||
|
||||
reloaded = Image.open(f)
|
||||
self.assert_image_equal(im, reloaded)
|
||||
|
||||
def test_truncated_file(self):
|
||||
path = self.tempfile('temp.pgm')
|
||||
with open(path, 'w') as f:
|
||||
|
|
Loading…
Reference in New Issue
Block a user