From 67032f504071c2a491836180401af6ad0c0b4177 Mon Sep 17 00:00:00 2001 From: jevans Date: Mon, 22 Jul 2013 19:13:26 -0400 Subject: [PATCH] Added test for error on truncated EOC file. --- glymur/test/test_format_corpus.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glymur/test/test_format_corpus.py b/glymur/test/test_format_corpus.py index 2f7347b..fdf042c 100644 --- a/glymur/test/test_format_corpus.py +++ b/glymur/test/test_format_corpus.py @@ -47,5 +47,9 @@ class TestSuite(unittest.TestCase): # The last segment is truncated, so there should not be an EOC marker. self.assertNotEqual(c.segment[-1].marker_id, 'EOC') + # The codestream is not as long as claimed. + with self.assertRaises(OSError): + j2k.read(rlevel=-1) + if __name__ == "__main__": unittest.main()