MCPcopy Create free account
hub / github.com/ImageEngine/cortex / test

Method test

test/IECoreGL/CachedConverterTest.py:48–65  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

46class 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

Callers

nothing calls this directly

Calls 4

convertMethod · 0.95
CachedConverterMethod · 0.80
createPlaneMethod · 0.80
PrimitiveVariableMethod · 0.80

Tested by

no test coverage detected