#NEWLINE# @ mock . patch . object ( glanceclient , 'Client' ) #NEWLINE# @ mock . patch . object ( clients . OpenStackClients , 'url_for' ) #NEWLINE# def test_clients_glance( 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 ( mock_url ) #NEWLINE# obj . _glance = None #NEWLINE# obj . glance ( ) #NEWLINE# mock_call . assert_called_once_with ( '2' , 'url_from_keystone' , token = '3bcc3d3a03f44e3d8377f9247b0ad155' ) #NEWLINE# mock_url . assert_called_once_with ( service_type = 'image' , endpoint_type = 'publicURL' , region_name = 'RegionOne' )