#NEWLINE# def testSetInput( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# n1 = GafferTest . AddNode ( ) #NEWLINE# n2 = GafferTest . AddNode ( ) #NEWLINE# s [ 'n1' ] = n1 #NEWLINE# s [ 'n2' ] = n2 #NEWLINE# with Gaffer . UndoContext ( self ) : #NEWLINE# #INDENT# n1 [ 'op1' ] . setInput ( n2 [ 'sum' ] ) #NEWLINE# #UNINDENT# self . assert_ ( n1 [ 'op1' ] . getInput ( ) . isSame ( n2 [ 'sum' ] ) ) #NEWLINE# s . undo ( ) #NEWLINE# self . assertEqual ( n1 [ 'op1' ] . getInput ( ) , None ) #NEWLINE# s . redo ( ) #NEWLINE# self . assert_ ( n1 [ 'op1' ] . getInput ( ) . isSame ( n2 [ 'sum' ] ) )