diff options
Diffstat (limited to 'test/reader/preview')
-rw-r--r-- | test/reader/preview/load_nef.py | 5 | ||||
-rw-r--r-- | test/reader/preview/test_pg.py | 6 | ||||
-rw-r--r-- | test/reader/preview/test_pillow.py | 11 | ||||
-rw-r--r-- | test/reader/preview/test_preview.py | 5 | ||||
-rw-r--r-- | test/reader/preview/test_rawpy.py | 5 | ||||
-rw-r--r-- | test/reader/preview/test_utils.py | 5 |
6 files changed, 6 insertions, 31 deletions
diff --git a/test/reader/preview/load_nef.py b/test/reader/preview/load_nef.py index 5ba0adc..02be470 100644 --- a/test/reader/preview/load_nef.py +++ b/test/reader/preview/load_nef.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 import os diff --git a/test/reader/preview/test_pg.py b/test/reader/preview/test_pg.py index e492cfa..30095c5 100644 --- a/test/reader/preview/test_pg.py +++ b/test/reader/preview/test_pg.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 @@ -57,6 +52,7 @@ class TestPreviewGeneratorReader(unittest.TestCase): self.assertEqual(sum(img.getdata()), 20258) # cleanup img.close() + del rdr # can define a cache dir pg_dir = tempfile.mkdtemp(prefix='bsie-test') 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) diff --git a/test/reader/preview/test_preview.py b/test/reader/preview/test_preview.py index fde610f..e144877 100644 --- a/test/reader/preview/test_preview.py +++ b/test/reader/preview/test_preview.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 importlib diff --git a/test/reader/preview/test_rawpy.py b/test/reader/preview/test_rawpy.py index ed35f53..11a6f9b 100644 --- a/test/reader/preview/test_rawpy.py +++ b/test/reader/preview/test_rawpy.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 importlib diff --git a/test/reader/preview/test_utils.py b/test/reader/preview/test_utils.py index c10c38c..2b15bc6 100644 --- a/test/reader/preview/test_utils.py +++ b/test/reader/preview/test_utils.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 import os import unittest |