<s> import unittest <EOL> import IECore <EOL> import Gaffer <EOL> import GafferTest <EOL> import GafferScene <EOL> import GafferSceneTest <EOL> class SceneTimeWarpTest ( GafferSceneTest . SceneTestCase ) : <EOL> def testConstruct ( self ) : <EOL> s = Gaffer . ScriptNode ( ) <EOL> s [ "<STR_LIT:n>" ] = GafferScene . SceneTimeWarp ( ) <EOL> self . assertEqual ( s [ "<STR_LIT:n>" ] [ "<STR_LIT>" ] . getValue ( ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( s [ "<STR_LIT:n>" ] [ "<STR_LIT>" ] . getValue ( ) , <NUM_LIT:0> ) <EOL> def testRunTimeTyped ( self ) : <EOL> n = GafferScene . SceneTimeWarp ( ) <EOL> self . failUnless ( n . isInstanceOf ( GafferScene . SceneTimeWarp . staticTypeId ( ) ) ) <EOL> self . failUnless ( n . isInstanceOf ( GafferScene . SceneContextProcessor . staticTypeId ( ) ) ) <EOL> self . failUnless ( n . isInstanceOf ( GafferScene . SceneProcessor . staticTypeId ( ) ) ) <EOL> self . failUnless ( n . isInstanceOf ( GafferScene . SceneNode . staticTypeId ( ) ) ) <EOL> self . failUnless ( n . isInstanceOf ( Gaffer . Node . staticTypeId ( ) ) ) <EOL> baseTypeIds = IECore . RunTimeTyped . baseTypeIds ( n . typeId ( ) ) <EOL> self . failUnless ( GafferScene . SceneContextProcessor . staticTypeId ( ) in baseTypeIds ) <EOL> self . failUnless ( GafferScene . SceneProcessor . staticTypeId ( ) in baseTypeIds ) <EOL> self . failUnless ( GafferScene . SceneNode . staticTypeId ( ) in baseTypeIds ) <EOL> self . failUnless ( Gaffer . Node . staticTypeId ( ) in baseTypeIds ) <EOL> def testAffects ( self ) : <EOL> n = GafferScene . SceneTimeWarp ( ) <EOL> c = GafferTest . CapturingSlot ( n . plugDirtiedSignal ( ) ) <EOL> n [ "<STR_LIT>" ] . setValue ( <NUM_LIT:2> ) <EOL> found = False <EOL> for cc in c : <EOL> if cc [ <NUM_LIT:0> ] . isSame ( n [ "<STR_LIT>" ] ) : <EOL> found = True <EOL> self . failUnless ( found ) <EOL> del c [ : ] <EOL> n [ "<STR_LIT>" ] . setValue ( <NUM_LIT:2> ) <EOL> found = False <EOL> for cc in c : <EOL> if cc [ <NUM_LIT:0> ] . isSame ( n [ "<STR_LIT>" ] ) : <EOL> found = True <EOL> self . failUnless ( found ) <EOL> def testNoExtraInputs ( self ) : <EOL> p = GafferScene . Plane ( ) <EOL> n = GafferScene . SceneTimeWarp ( ) <EOL> n [ "<STR_LIT>" ] . setInput ( p [ "<STR_LIT>" ] ) <EOL> self . assertTrue ( "<STR_LIT>" not in n ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
