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

Method testUserAttributes

test/IECoreGL/State.py:54–69  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

52 self.assertTrue( s.isComplete() )
53
54 def testUserAttributes( self ) :
55
56 s = IECoreGL.State( False)
57
58 self.assertEqual( s.userAttributes(), IECore.CompoundData() )
59 self.assertTrue( s.userAttributes().isSame( s.userAttributes() ) )
60
61 s.userAttributes()["test"] = IECore.IntData( 1 )
62 self.assertEqual( s.userAttributes(), IECore.CompoundData( { "test" : IECore.IntData( 1 ) } ) )
63
64 s2 = IECoreGL.State( s )
65 self.assertEqual( s.userAttributes(), s2.userAttributes() )
66
67 s2.userAttributes()["test2"] = IECore.IntData( 20 )
68 self.assertEqual( s.userAttributes(), IECore.CompoundData( { "test" : IECore.IntData( 1 ) } ) )
69 self.assertEqual( s2.userAttributes(), IECore.CompoundData( { "test" : IECore.IntData( 1 ), "test2" : IECore.IntData( 20 ) } ) )
70
71 def testScopedBinding( self ) :
72

Callers

nothing calls this directly

Calls 3

userAttributesMethod · 0.95
StateMethod · 0.80
CompoundDataMethod · 0.80

Tested by

no test coverage detected