#NEWLINE# def test_call_internal_server_error( self ) : #NEWLINE# #INDENT# req = mock . Mock ( ) #NEWLINE# with mock . patch . object ( req . handler , '_get_instance_and_tenant_id' ) as get_ids : #NEWLINE# #INDENT# get_ids . side_effect = Exception #NEWLINE# retval = self . handler ( req ) #NEWLINE# self . assertIsInstance ( retval , webob . exc . HTTPInternalServerError ) #NEWLINE# self . assertEqual ( len ( self . log . mock_calls ) , 2 )