aboutsummaryrefslogtreecommitdiffstats
path: root/test/reader/preview/test_pillow.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-03-05 19:22:46 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-03-05 19:22:46 +0100
commitaf81318ae9311fd0b0e16949cef3cfaf7996970b (patch)
treefb220da28bb7248ebf37ce09af5de88f2c1aaad4 /test/reader/preview/test_pillow.py
parent7bf6b33fa6d6b901e4933bfe0b2a9939d7b3f3f3 (diff)
parent8b460aa0232cd841af7b7734c91982bc83486e03 (diff)
downloadbsie-af81318ae9311fd0b0e16949cef3cfaf7996970b.tar.gz
bsie-af81318ae9311fd0b0e16949cef3cfaf7996970b.tar.bz2
bsie-af81318ae9311fd0b0e16949cef3cfaf7996970b.zip
Merge branch 'mb/diogenes' into develop
Diffstat (limited to 'test/reader/preview/test_pillow.py')
-rw-r--r--test/reader/preview/test_pillow.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/reader/preview/test_pillow.py b/test/reader/preview/test_pillow.py
index ca38d89..20f08ec 100644
--- a/test/reader/preview/test_pillow.py
+++ b/test/reader/preview/test_pillow.py
@@ -1,9 +1,4 @@
-"""
-Part of the bsie test suite.
-A copy of the license is provided with the project.
-Author: Matthias Baumgartner, 2022
-"""
# standard imports
from functools import partial
import os
@@ -25,11 +20,15 @@ class TestPillowPreviewReader(unittest.TestCase):
def test_call(self):
rdr = PillowPreviewReader()
# raises exception when image cannot be read
- self.assertRaises(errors.ReaderError, rdr,
+ self.assertRaises(errors.UnsupportedFileFormatError, rdr,
os.path.join(os.path.dirname(__file__), 'invalid.jpg'))
+ # raises exception when image cannot be read
+ self.assertRaises(errors.ReaderError, rdr,
+ os.path.join(os.path.dirname(__file__), 'inexistent.jpg'))
# raises exception when image has invalid type
self.assertRaises(errors.UnsupportedFileFormatError, rdr,
os.path.join(os.path.dirname(__file__), 'invalid.foo'))
+
# proper file produces a generator
gen = rdr(os.path.join(os.path.dirname(__file__), 'testimage.jpg'))
self.assertIsInstance(gen, partial)