From 6a1f1b772ae6dd1b795371dfa15fd9cd7978e69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 Dec 2023 01:38:45 +0100 Subject: [PATCH] python: properly test all trade.AbstractImporter texture APIs. Meshes, scenes, images all have this, textures not for some reason. --- src/python/magnum/test/test_trade.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/python/magnum/test/test_trade.py b/src/python/magnum/test/test_trade.py index ea054f2..f798a0e 100644 --- a/src/python/magnum/test/test_trade.py +++ b/src/python/magnum/test/test_trade.py @@ -1587,6 +1587,17 @@ class Importer(unittest.TestCase): with self.assertRaisesRegex(RuntimeError, "import failed"): importer.mesh('A broken mesh') + def test_texture(self): + importer = trade.ImporterManager().load_and_instantiate('GltfImporter') + + importer.open_file(os.path.join(os.path.dirname(__file__), 'texture.gltf')) + self.assertEqual(importer.texture_count, 3) + self.assertEqual(importer.texture_name(1), 'A broken texture') + self.assertEqual(importer.texture_for_name('A broken texture'), 1) + + texture = importer.texture(2) + self.assertEqual(texture.image, 1) + def test_texture_by_name(self): importer = trade.ImporterManager().load_and_instantiate('GltfImporter') importer.open_file(os.path.join(os.path.dirname(__file__), 'texture.gltf'))