File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ # Comment
2+ mtllib simple_missing.mtl
3+ o Simple
4+ v 0.01 0.02 0.03
5+ v 0.04 0.05 0.06
6+ v 0.07 0.08 0.09
7+ v 0.11 0.12 0.13
8+ vt 10 11
9+ vt 12 13
10+ vt 14 15
11+ vt 16 17
12+ vn 20 21 22
13+ usemtl Material.simple
14+ f 2 /3 /1 1 /2 /1 3 /1 /1
15+ o SimpleB
16+ v 1.0 0.0 1.0
17+ v -1.0 0.0 1.0
18+ v 1.0 0.0 -1.0
19+ v -1.0 0.0 -1.0
20+ vt 0.0 1.0
21+ vt 0.0 0.0
22+ vt 1.0 0.0
23+ vt 1.0 1.0
24+ vn 0.0 1.0 -0.0
25+ usemtl Material2.simple
26+ f 6 /7 /2 5 /6 /2 7 /5 /2
Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ def setUp(self):
5454 self .mesh2 = meshes .mesh_list [1 ]
5555
5656
57+ class TestParserMissingMaterials (unittest .TestCase ):
58+ """Test `create_materials` functionality"""
59+
60+ def test_missing_material_error (self ):
61+ """Parser should crash if `create_materials` is not set"""
62+ with self .assertRaises (IOError ):
63+ pywavefront .Wavefront (prepend_dir ('simple_missing_material.obj' ))
64+
65+ def test_missing_material_create (self ):
66+ """Parser should handle missing materials if `create_materials` is set"""
67+ pywavefront .Wavefront (prepend_dir ('simple_missing_material.obj' ), create_materials = True )
68+
69+
5770class TestParserVertexVariants (unittest .TestCase ):
5871
5972 def testObjNoNormals (self ):
You can’t perform that action at this time.
0 commit comments