#NEWLINE# def testLinear( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'n' ] = Gaffer . Node ( ) #NEWLINE# s [ 'n' ] [ 'user' ] [ 'f' ] = Gaffer . FloatPlug ( flags = ( Gaffer . Plug . Flags . Default | Gaffer . Plug . Flags . Dynamic ) ) #NEWLINE# curve = Gaffer . Animation . acquire ( s [ 'n' ] [ 'user' ] [ 'f' ] ) #NEWLINE# curve . addKey ( Gaffer . Animation . Key ( 0 , 1 , Gaffer . Animation . Type . Linear ) ) #NEWLINE# curve . addKey ( Gaffer . Animation . Key ( 1 , 3 , Gaffer . Animation . Type . Linear ) ) #NEWLINE# with Gaffer . Context ( ) as c : #NEWLINE# #INDENT# for i in range ( 0 , 10 ) : #NEWLINE# #INDENT# c . setTime ( ( c / 9.0 ) ) #NEWLINE# self . assertAlmostEqual ( s [ 'n' ] [ 'user' ] [ 'f' ] . getValue ( ) , ( 1 + ( c . getTime ( ) * 2 ) ) , 6 )