aboutsummaryrefslogtreecommitdiffstats
path: root/test/reader/preview
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
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')
-rw-r--r--test/reader/preview/load_nef.py5
-rw-r--r--test/reader/preview/test_pg.py6
-rw-r--r--test/reader/preview/test_pillow.py11
-rw-r--r--test/reader/preview/test_preview.py5
-rw-r--r--test/reader/preview/test_rawpy.py5
-rw-r--r--test/reader/preview/test_utils.py5
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