( self )
| 87 | self.assertEqual( state2.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "bob" ) |
| 88 | |
| 89 | def testOverrides( self ) : |
| 90 | |
| 91 | state1 = IECoreGL.State( True ) |
| 92 | state1.add( IECoreGL.NameStateComponent( "billy" ) ) |
| 93 | |
| 94 | state2 = IECoreGL.State( False ) |
| 95 | state2.add( IECoreGL.NameStateComponent( "bob" ), override = True ) |
| 96 | |
| 97 | state3 = IECoreGL.State( False ) |
| 98 | state3.add( IECoreGL.NameStateComponent( "jane" ), override = False ) |
| 99 | |
| 100 | with IECoreGL.State.ScopedBinding( state2, state1 ) : |
| 101 | |
| 102 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "bob" ) |
| 103 | |
| 104 | with IECoreGL.State.ScopedBinding( state3, state1 ) : |
| 105 | |
| 106 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "bob" ) |
| 107 | |
| 108 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "bob" ) |
| 109 | |
| 110 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "billy" ) |
| 111 | |
| 112 | with IECoreGL.State.ScopedBinding( state3, state1 ) : |
| 113 | |
| 114 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "jane" ) |
| 115 | |
| 116 | with IECoreGL.State.ScopedBinding( state2, state1 ) : |
| 117 | |
| 118 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "bob" ) |
| 119 | |
| 120 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "jane" ) |
| 121 | |
| 122 | self.assertEqual( state1.get( IECoreGL.NameStateComponent.staticTypeId() ).name(), "billy" ) |
| 123 | |
| 124 | if __name__ == "__main__": |
| 125 | unittest.main() |
nothing calls this directly
no test coverage detected