#NEWLINE# def testSetExpressionShortcuts( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'n' ] = Gaffer . Node ( ) #NEWLINE# s [ 'n' ] [ 'user' ] [ 'i' ] = Gaffer . IntPlug ( flags = ( Gaffer . Plug . Flags . Default | Gaffer . Plug . Flags . Dynamic ) ) #NEWLINE# s [ 'e' ] = Gaffer . Expression ( ) #NEWLINE# cs = GafferTest . CapturingSlot ( s [ 'e' ] . expressionChangedSignal ( ) ) #NEWLINE# s [ 'e' ] . setExpression ( 'parent["n"]["user"]["i"] = 10' ) #NEWLINE# self . assertEqual ( len ( cs ) , 1 ) #NEWLINE# s [ 'e' ] . setExpression ( 'parent["n"]["user"]["i"] = 10' ) #NEWLINE# self . assertEqual ( len ( cs ) , 1 ) #NEWLINE# s [ 'e' ] . setExpression ( 'parent["n"]["user"]["i"] = 20' ) #NEWLINE# self . assertEqual ( len ( cs ) , 2 )