#NEWLINE# def testAcquireDeletesClosedWindows( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'n' ] = Gaffer . Node ( ) #NEWLINE# sw = GafferUI . ScriptWindow . acquire ( s ) #NEWLINE# ne = GafferUI . NodeEditor . acquire ( s [ 'n' ] ) #NEWLINE# nw = ne . ancestor ( GafferUI . Window ) #NEWLINE# self . failUnless ( ( nw . parent ( ) is ne ) ) #NEWLINE# nww = weakref . ref ( nw ) #NEWLINE# nw . close ( ) #NEWLINE# del nw #NEWLINE# self . assertEqual ( nww ( ) , None ) #NEWLINE# self . assertEqual ( sw . childWindows ( ) , [ ] ) #NEWLINE# ne2 = GafferUI . NodeEditor . acquire ( s [ 'n' ] ) #NEWLINE# self . failUnless ( isinstance ( ne2 , GafferUI . NodeEditor ) )