#NEWLINE# def testSetName( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# self . assertEqual ( s . undoAvailable ( ) , False ) #NEWLINE# self . assertEqual ( s . redoAvailable ( ) , False ) #NEWLINE# self . assertRaises ( Exception , s . undo ) #NEWLINE# n = Gaffer . Node ( ) #NEWLINE# s [ 'a' ] = n #NEWLINE# self . assertEqual ( n . getName ( ) , 'a' ) #NEWLINE# n . setName ( 'b' ) #NEWLINE# self . assertEqual ( n . getName ( ) , 'b' ) #NEWLINE# self . assertEqual ( s . undoAvailable ( ) , False ) #NEWLINE# self . assertEqual ( s . redoAvailable ( ) , False ) #NEWLINE# self . assertRaises ( Exception , s . undo ) #NEWLINE# with Gaffer . UndoContext ( s ) : #NEWLINE# #INDENT# n . setName ( 'c' ) #NEWLINE# #UNINDENT# self . assertEqual ( s . undoAvailable ( ) , True ) #NEWLINE# self . assertEqual ( s . redoAvailable ( ) , False ) #NEWLINE# s . undo ( ) #NEWLINE# self . assertEqual ( s . undoAvailable ( ) , False ) #NEWLINE# self . assertEqual ( s . redoAvailable ( ) , True ) #NEWLINE# self . assertEqual ( n . getName ( ) , 'b' ) #NEWLINE# s . redo ( ) #NEWLINE# self . assertEqual ( s . undoAvailable ( ) , True ) #NEWLINE# self . assertEqual ( s . redoAvailable ( ) , False ) #NEWLINE# self . assertEqual ( n . getName ( ) , 'c' ) #NEWLINE# self . assertRaises ( Exception , s . redo )