|
|
|
@ -657,7 +657,7 @@ class Importer(unittest.TestCase): |
|
|
|
importer.mesh_level_count(0) |
|
|
|
importer.mesh_level_count(0) |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
importer.mesh_name(0) |
|
|
|
importer.mesh_name(0) |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaisesRegex(IndexError, "ID out of bounds"): |
|
|
|
importer.mesh(0) |
|
|
|
importer.mesh(0) |
|
|
|
|
|
|
|
|
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
@ -674,13 +674,13 @@ class Importer(unittest.TestCase): |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
importer.image3d_name(0) |
|
|
|
importer.image3d_name(0) |
|
|
|
|
|
|
|
|
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaisesRegex(IndexError, "ID out of bounds"): |
|
|
|
importer.image1d(0) |
|
|
|
importer.image1d(0) |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaisesRegex(IndexError, "level out of bounds"): |
|
|
|
importer.image2d(0, 1) |
|
|
|
importer.image2d(0, 1) |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaisesRegex(IndexError, "ID out of bounds"): |
|
|
|
importer.image2d(1) |
|
|
|
importer.image2d(1) |
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaisesRegex(IndexError, "ID out of bounds"): |
|
|
|
importer.image3d(0) |
|
|
|
importer.image3d(0) |
|
|
|
|
|
|
|
|
|
|
|
def test_open_failed(self): |
|
|
|
def test_open_failed(self): |
|
|
|
@ -750,7 +750,7 @@ class Importer(unittest.TestCase): |
|
|
|
importer = trade.ImporterManager().load_and_instantiate('GltfImporter') |
|
|
|
importer = trade.ImporterManager().load_and_instantiate('GltfImporter') |
|
|
|
importer.open_file(os.path.join(os.path.dirname(__file__), 'mesh.gltf')) |
|
|
|
importer.open_file(os.path.join(os.path.dirname(__file__), 'mesh.gltf')) |
|
|
|
|
|
|
|
|
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaisesRegex(IndexError, "level out of bounds"): |
|
|
|
importer.mesh('Non-indexed mesh', 1) |
|
|
|
importer.mesh('Non-indexed mesh', 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_mesh_failed(self): |
|
|
|
def test_mesh_failed(self): |
|
|
|
@ -790,7 +790,7 @@ class Importer(unittest.TestCase): |
|
|
|
importer = trade.ImporterManager().load_and_instantiate('StbImageImporter') |
|
|
|
importer = trade.ImporterManager().load_and_instantiate('StbImageImporter') |
|
|
|
importer.open_file(os.path.join(os.path.dirname(__file__), 'rgb.png')) |
|
|
|
importer.open_file(os.path.join(os.path.dirname(__file__), 'rgb.png')) |
|
|
|
|
|
|
|
|
|
|
|
with self.assertRaises(IndexError): |
|
|
|
with self.assertRaisesRegex(IndexError, "level out of bounds"): |
|
|
|
importer.image2d(0, 1) |
|
|
|
importer.image2d(0, 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_image2d_by_name(self): |
|
|
|
def test_image2d_by_name(self): |
|
|
|
|