#NEWLINE# @ mock . patch . object ( push . Screen , 'close' , create = True ) #NEWLINE# def test_connectionLost( self , mock_close ) : #NEWLINE# #INDENT# self . screen . connectionLost ( 'abc' ) #NEWLINE# msg = 'Screen.connectionLost() called. Reason:%s' #NEWLINE# push . logger . error . assert_called_with ( msg , 'abc' ) #NEWLINE# mock_close . assert_called_once_with ( )