<s> import unittest <EOL> import pyglet <EOL> import pywavefront . parser <EOL> class TestParsers ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pyglet . resource . path . append ( '<STR_LIT:@>' + __name__ ) <EOL> pyglet . resource . reindex ( ) <EOL> meshes = pywavefront . Wavefront ( '<STR_LIT>' ) <EOL> self . mesh1 = meshes . mesh_list [ <NUM_LIT:0> ] <EOL> self . mesh2 = meshes . mesh_list [ <NUM_LIT:1> ] <EOL> def testObjName ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertEqual ( self . mesh1 . name , '<STR_LIT>' ) <EOL> self . assertEqual ( self . mesh2 . name , '<STR_LIT>' ) <EOL> def testObjVertices ( self ) : <EOL> "<STR_LIT>" <EOL> material = self . mesh1 . materials [ <NUM_LIT:0> ] <EOL> self . assertEqual ( material . vertices , [ <EOL> <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <EOL> <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <EOL> <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] ) <EOL> def testObjMaterials ( self ) : <EOL> "<STR_LIT>" <EOL> material1 = self . mesh1 . materials [ <NUM_LIT:0> ] <EOL> material2 = self . mesh2 . materials [ <NUM_LIT:0> ] <EOL> self . assertEqual ( material1 . name , '<STR_LIT>' ) <EOL> self . assertEqual ( material2 . name , '<STR_LIT>' ) <EOL> class TestMtlParser ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pyglet . resource . path . append ( '<STR_LIT:@>' + __name__ ) <EOL> pyglet . resource . reindex ( ) <EOL> meshes = pywavefront . Wavefront ( '<STR_LIT>' ) <EOL> self . material1 = meshes . mesh_list [ <NUM_LIT:0> ] . materials [ <NUM_LIT:0> ] <EOL> self . material2 = meshes . mesh_list [ <NUM_LIT:1> ] . materials [ <NUM_LIT:0> ] <EOL> def testMtlName ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertEqual ( self . material1 . name , '<STR_LIT>' ) <EOL> self . assertEqual ( self . material2 . name , '<STR_LIT>' ) <EOL> def testMtlShininess ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertEqual ( self . material1 . shininess , <NUM_LIT:1.0> ) <EOL> def testMtlAmbient ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertEqual ( self . material1 . ambient , [ <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:0.> , <NUM_LIT:1.> ] ) <EOL> def testMtlDiffuse ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertEqual ( self . material1 . diffuse , [ <NUM_LIT:0.1> , <NUM_LIT:0.1> , <NUM_LIT:0.1> , <NUM_LIT:1.> ] ) <EOL> def testMtlSpecular ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertEqual ( self . material1 . specular , [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1.> ] ) <EOL> def testMtlTextureName ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertEqual ( self . material1 . texture . image_name , '<STR_LIT>' ) <EOL> class TestParserFailure ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pyglet . resource . path . append ( '<STR_LIT:@>' + __name__ ) <EOL> pyglet . resource . reindex ( ) <EOL> def testMissingParseFunction ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertRaises ( Exception , pywavefront . parser . Parser , '<STR_LIT>' ) <EOL> def testMissingParsedFile ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertRaises ( Exception , pywavefront . parser . Parser , '<STR_LIT>' ) </s>
