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'))