#NEWLINE# def test_manila( self ) : #NEWLINE# #INDENT# mock_manila = mock . MagicMock ( ) #NEWLINE# self . assertNotIn ( 'manila' , self . clients . cache ) #NEWLINE# with mock . patch . dict ( 'sys.modules' , { #NEWLINE# #INDENT# 'manilaclient' : mock_manila , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# client = self . clients . manila ( ) #NEWLINE# self . assertEqual ( mock_manila . client . Client . return_value , client ) #NEWLINE# self . service_catalog . url_for . assert_called_once_with ( service_type = 'share' , endpoint_type = consts . EndpointType . PUBLIC , region_name = self . credential . region_name ) #NEWLINE# mock_manila . client . Client . assert_called_once_with ( '1' , http_log_debug = False , timeout = cfg . CONF . openstack_client_http_timeout , insecure = False , cacert = None , username = self . credential . username , api_key = self . credential . password , region_name = self . credential . region_name , project_name = self . credential . tenant_name , auth_url = self . credential . auth_url ) #NEWLINE# self . assertEqual ( mock_manila . client . Client . return_value . client . management_url , self . service_catalog . url_for . return_value ) #NEWLINE# self . assertEqual ( mock_manila . client . Client . return_value . client . auth_token , self . fake_keystone . auth_token ) #NEWLINE# self . assertEqual ( mock_manila . client . Client . return_value , self . clients . cache [ 'manila' ] )