<s> import unittest <EOL> import IECore <EOL> import Gaffer <EOL> import GafferTest <EOL> import GafferScene <EOL> import GafferSceneTest <EOL> class DeletePrimitiveVariablesTest ( GafferSceneTest . SceneTestCase ) : <EOL> def test ( self ) : <EOL> p = GafferScene . Plane ( ) <EOL> d = GafferScene . DeletePrimitiveVariables ( ) <EOL> d [ "<STR_LIT>" ] . setInput ( p [ "<STR_LIT>" ] ) <EOL> self . assertEqual ( p [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) , d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) ) <EOL> self . assertSceneHashesEqual ( p [ "<STR_LIT>" ] , d [ "<STR_LIT>" ] ) <EOL> self . failUnless ( "<STR_LIT:s>" in d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) ) <EOL> self . failUnless ( "<STR_LIT:t>" in d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) ) <EOL> d [ "<STR_LIT>" ] . setValue ( "<STR_LIT>" ) <EOL> self . assertNotEqual ( p [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) , d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) ) <EOL> self . assertSceneHashesEqual ( p [ "<STR_LIT>" ] , d [ "<STR_LIT>" ] , childPlugNames = ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> self . assertSceneHashesEqual ( p [ "<STR_LIT>" ] , d [ "<STR_LIT>" ] , pathsToIgnore = ( "<STR_LIT>" ) ) <EOL> self . failUnless ( "<STR_LIT:s>" not in d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) ) <EOL> self . failUnless ( "<STR_LIT:t>" not in d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) ) <EOL> self . assertTrue ( "<STR_LIT:P>" in d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) ) <EOL> def testNonPrimitiveObject ( self ) : <EOL> c = GafferScene . Camera ( ) <EOL> d = GafferScene . DeletePrimitiveVariables ( ) <EOL> d [ "<STR_LIT>" ] . setInput ( c [ "<STR_LIT>" ] ) <EOL> self . assertSceneValid ( d [ "<STR_LIT>" ] ) <EOL> self . failUnless ( isinstance ( d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) , IECore . Camera ) ) <EOL> def testAffects ( self ) : <EOL> d = GafferScene . DeletePrimitiveVariables ( ) <EOL> cs = GafferTest . CapturingSlot ( d . plugDirtiedSignal ( ) ) <EOL> self . assertEqual ( len ( cs ) , <NUM_LIT:0> ) <EOL> d [ "<STR_LIT>" ] . setValue ( False ) <EOL> self . assertTrue ( "<STR_LIT>" in [ x [ <NUM_LIT:0> ] . getName ( ) for x in cs ] ) <EOL> def testWildcards ( self ) : <EOL> p = GafferScene . Plane ( ) <EOL> d = GafferScene . DeletePrimitiveVariables ( ) <EOL> d [ "<STR_LIT>" ] . setInput ( p [ "<STR_LIT>" ] ) <EOL> d [ "<STR_LIT>" ] . setValue ( "<STR_LIT:*>" ) <EOL> self . assertEqual ( d [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) . keys ( ) , [ ] ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
