From 47226d22f6f428c0db68c4c7e91bb48fbb5be00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 9 Feb 2023 00:14:39 +0100 Subject: [PATCH] python: test also named AbstractImporter APIs with no file opened. Code coverage says red! --- src/python/magnum/test/test_trade.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/python/magnum/test/test_trade.py b/src/python/magnum/test/test_trade.py index 667c33f..74faf18 100644 --- a/src/python/magnum/test/test_trade.py +++ b/src/python/magnum/test/test_trade.py @@ -605,6 +605,8 @@ class Importer(unittest.TestCase): with self.assertRaisesRegex(AssertionError, "no file opened"): importer.mesh(0) + with self.assertRaisesRegex(AssertionError, "no file opened"): + importer.mesh('') with self.assertRaisesRegex(AssertionError, "no file opened"): importer.image1d_count @@ -636,10 +638,16 @@ class Importer(unittest.TestCase): with self.assertRaisesRegex(AssertionError, "no file opened"): importer.image1d(0) + with self.assertRaisesRegex(AssertionError, "no file opened"): + importer.image1d('') with self.assertRaisesRegex(AssertionError, "no file opened"): importer.image2d(0) + with self.assertRaisesRegex(AssertionError, "no file opened"): + importer.image2d('') with self.assertRaisesRegex(AssertionError, "no file opened"): importer.image3d(0) + with self.assertRaisesRegex(AssertionError, "no file opened"): + importer.image3d('') def test_index_oob(self): importer = trade.ImporterManager().load_and_instantiate('StbImageImporter')