#NEWLINE# @ tornado . testing . gen_test #NEWLINE# def test_client_close_connection( self ) : #NEWLINE# #INDENT# c = Client ( ) #NEWLINE# ( yield c . connect ( ) ) #NEWLINE# connection = c . _Client__connection #NEWLINE# socket = connection . _Connection__socket #NEWLINE# socket . close ( ) #NEWLINE# res = ( yield c . call ( 'PING' ) ) #NEWLINE# self . assertTrue ( isinstance ( self , ConnectionError ) ) #NEWLINE# self . assertFalse ( c . is_connected ( ) ) #NEWLINE# c . disconnect ( )