( self )
| 46 | class CachedConverterTest( unittest.TestCase ) : |
| 47 | |
| 48 | def test( self ) : |
| 49 | |
| 50 | c = IECoreGL.CachedConverter( 500 * 1024 * 1024 ) # 500 megs |
| 51 | |
| 52 | m = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( -1 ), imath.V2f( -1 ) ) ) |
| 53 | gm = c.convert( m ) |
| 54 | |
| 55 | m2 = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( -1 ), imath.V2f( -1 ) ) ) |
| 56 | gm2 = c.convert( m2 ) |
| 57 | |
| 58 | self.assertTrue( gm.isSame( gm2 ) ) |
| 59 | |
| 60 | m3 = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( -1 ), imath.V2f( -1 ) ) ) |
| 61 | m3["a"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Constant, IECore.IntData( 1 ) ) |
| 62 | |
| 63 | gm3 = c.convert( m3 ) |
| 64 | |
| 65 | self.assertFalse( gm.isSame( gm3 ) ) |
| 66 | |
| 67 | def testDefaultInstance( self ) : |
| 68 |
nothing calls this directly
no test coverage detected