#NEWLINE# def testDisconnectInput( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'n' ] = Gaffer . Node ( ) #NEWLINE# s [ 'n' ] [ 'user' ] [ 'a' ] = Gaffer . IntPlug ( flags = ( Gaffer . Plug . Flags . Default | Gaffer . Plug . Flags . Dynamic ) ) #NEWLINE# s [ 'n' ] [ 'user' ] [ 'b' ] = Gaffer . IntPlug ( flags = ( Gaffer . Plug . Flags . Default | Gaffer . Plug . Flags . Dynamic ) ) #NEWLINE# s [ 'n' ] [ 'user' ] [ 'b' ] . setValue ( 1 ) #NEWLINE# s [ 'e' ] = Gaffer . Expression ( ) #NEWLINE# s [ 'e' ] . setExpression ( 'parent["n"]["user"]["a"] = parent["n"]["user"]["b"]' ) #NEWLINE# self . assertEqual ( s [ 'n' ] [ 'user' ] [ 'a' ] . getValue ( ) , 1 ) #NEWLINE# s [ 'n' ] [ 'user' ] [ 'b' ] . removeOutputs ( ) #NEWLINE# self . assertTrue ( s [ 'n' ] [ 'user' ] [ 'a' ] . getInput ( ) . node ( ) . isSame ( s [ 'e' ] ) ) #NEWLINE# self . assertEqual ( s [ 'n' ] [ 'user' ] [ 'a' ] . getValue ( ) , 0 ) #NEWLINE# self . assertEqual ( len ( s [ 'n' ] [ 'user' ] [ 'b' ] . outputs ( ) ) , 0 ) #NEWLINE# s2 = Gaffer . ScriptNode ( ) #NEWLINE# s2 . execute ( s . serialise ( ) ) #NEWLINE# self . assertTrue ( s [ 'n' ] [ 'user' ] [ 'a' ] . getInput ( ) . node ( ) . isSame ( self [ 'e' ] ) ) #NEWLINE# self . assertEqual ( s2 [ 'n' ] [ 'user' ] [ 'a' ] . getValue ( ) , 0 ) #NEWLINE# self . assertEqual ( len ( s [ 'n' ] [ 'user' ] [ 'b' ] . outputs ( ) ) , 0 )