From 954e86a2abed68c43a9f97dc4df84ec2e0f492a0 Mon Sep 17 00:00:00 2001 From: jevans Date: Wed, 22 Oct 2014 20:23:45 -0400 Subject: [PATCH] added negative test for int32 imagery, closes #291 --- glymur/test/test_jp2k.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index 3f3fa55..7c4e2a3 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -859,7 +859,15 @@ class TestJp2k_write(unittest.TestCase): j = Jp2k(tfile.name, 'wb') j.write(data, cbsize=(16, 16), psizes=[(48, 48)]) - def test_unsupported_datatype(self): + def test_unsupported_int32(self): + """Should raise a runtime error if trying to write int32""" + data = np.zeros((128, 128), dtype=np.int32) + with tempfile.NamedTemporaryFile(suffix='.j2k') as tfile: + with self.assertRaises(RuntimeError): + j = Jp2k(tfile.name, 'wb') + j.write(data) + + def test_unsupported_uint32(self): """Should raise a runtime error if trying to write uint32""" data = np.zeros((128, 128), dtype=np.uint32) with tempfile.NamedTemporaryFile(suffix='.j2k') as tfile: