#NEWLINE# def test_Close_should_kill_the_connection( self ) : #NEWLINE# #INDENT# shell_backup = self . _get_backup ( self . interactive_shell , 'Run' , 'Connection' ) #NEWLINE# self . interactive_shell . Run = MethodMock ( 1 , 'exit' ) #NEWLINE# self . interactive_shell . Connection = flexmock ( ) #NEWLINE# self . interactive_shell . Connection . should_receive ( 'kill' ) . once ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . interactive_shell . Close ( None ) #NEWLINE# assert_that ( ( self . interactive_shell . Connection is None ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . _restore_backup ( shell_backup . interactive_shell , shell_backup )