Skip to content

Commit

Permalink
added test for reading TIFF from non-disk file obj
Browse files Browse the repository at this point in the history
  • Loading branch information
chadawagner authored and radarhere committed Aug 12, 2019
1 parent 597ca79 commit 457a97d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/test_file_libtiff.py
Expand Up @@ -81,6 +81,19 @@ def test_g4_tiff_bytesio(self):
self.assertEqual(im.size, (500, 500))
self._assert_noerr(im)

def test_g4_non_disk_file_object(self):
"""Testing loading from non-disk non-bytesio file object"""
test_file = "Tests/images/hopper_g4_500.tif"
s = io.BytesIO()
with open(test_file, "rb") as f:
s.write(f.read())
s.seek(0)
r = io.BufferedReader(s)
im = Image.open(r)

self.assertEqual(im.size, (500, 500))
self._assert_noerr(im)

def test_g4_eq_png(self):
""" Checking that we're actually getting the data that we expect"""
png = Image.open("Tests/images/hopper_bw_500.png")
Expand Down

0 comments on commit 457a97d

Please sign in to comment.