#NEWLINE# def testContextAccess( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'm' ] = GafferTest . MultiplyNode ( ) #NEWLINE# s [ 'm' ] [ 'op1' ] . setValue ( 1 ) #NEWLINE# s [ 'e' ] = Gaffer . Expression ( ) #NEWLINE# s [ 'e' ] . setExpression ( 'parent["m"]["op2"] = int( context["frame"] * 2 )' , 'python' ) #NEWLINE# context = Gaffer . Context ( ) #NEWLINE# context . setFrame ( 10 ) #NEWLINE# with s : #NEWLINE# #INDENT# self . assertEqual ( s [ 'm' ] [ 'product' ] . getValue ( ) , 20 )