#NEWLINE# @ mock . patch . object ( mistralclient , 'client' ) #NEWLINE# @ mock . patch . object ( clients . OpenStackClients , 'url_for' ) #NEWLINE# def test_clients_mistral_cached( self , mock_url , mock_call ) : #NEWLINE# #INDENT# con = mock . MagicMock ( ) #NEWLINE# con . tenant = 'b363706f891f48019483f8bd6503c54d' #NEWLINE# con . auth_token = '3bcc3d3a03f44e3d8377f9247b0ad155' #NEWLINE# mock_url . return_value = 'url_from_keystone' #NEWLINE# obj = clients . OpenStackClients ( con ) #NEWLINE# obj . _mistral = None #NEWLINE# mistral = obj . mistral ( ) #NEWLINE# mistral_cached = obj . mistral ( ) #NEWLINE# self . assertEqual ( mistral , mistral_cached )