@@ -80,12 +80,16 @@ def setUp(self):
8080 def test_client_manager_token_endpoint (self ):
8181
8282 client_manager = clientmanager .ClientManager (
83- auth_options = FakeOptions (os_token = fakes .AUTH_TOKEN ,
84- os_url = fakes .AUTH_URL ,
85- os_auth_type = 'token_endpoint' ),
83+ cli_options = FakeOptions (
84+ os_token = fakes .AUTH_TOKEN ,
85+ os_url = fakes .AUTH_URL ,
86+ os_auth_type = 'token_endpoint' ,
87+ ),
8688 api_version = API_VERSION ,
8789 verify = True
8890 )
91+ client_manager .setup_auth ()
92+
8993 self .assertEqual (
9094 fakes .AUTH_URL ,
9195 client_manager ._url ,
@@ -104,12 +108,15 @@ def test_client_manager_token_endpoint(self):
104108 def test_client_manager_token (self ):
105109
106110 client_manager = clientmanager .ClientManager (
107- auth_options = FakeOptions (os_token = fakes .AUTH_TOKEN ,
108- os_auth_url = fakes .AUTH_URL ,
109- os_auth_type = 'v2token' ),
111+ cli_options = FakeOptions (
112+ os_token = fakes .AUTH_TOKEN ,
113+ os_auth_url = fakes .AUTH_URL ,
114+ os_auth_type = 'v2token' ,
115+ ),
110116 api_version = API_VERSION ,
111117 verify = True
112118 )
119+ client_manager .setup_auth ()
113120
114121 self .assertEqual (
115122 fakes .AUTH_URL ,
@@ -125,13 +132,16 @@ def test_client_manager_token(self):
125132 def test_client_manager_password (self ):
126133
127134 client_manager = clientmanager .ClientManager (
128- auth_options = FakeOptions (os_auth_url = fakes .AUTH_URL ,
129- os_username = fakes .USERNAME ,
130- os_password = fakes .PASSWORD ,
131- os_project_name = fakes .PROJECT_NAME ),
135+ cli_options = FakeOptions (
136+ os_auth_url = fakes .AUTH_URL ,
137+ os_username = fakes .USERNAME ,
138+ os_password = fakes .PASSWORD ,
139+ os_project_name = fakes .PROJECT_NAME ,
140+ ),
132141 api_version = API_VERSION ,
133142 verify = False ,
134143 )
144+ client_manager .setup_auth ()
135145
136146 self .assertEqual (
137147 fakes .AUTH_URL ,
@@ -182,14 +192,17 @@ def stub_auth(self, json=None, url=None, verb=None, **kwargs):
182192 def test_client_manager_password_verify_ca (self ):
183193
184194 client_manager = clientmanager .ClientManager (
185- auth_options = FakeOptions (os_auth_url = fakes .AUTH_URL ,
186- os_username = fakes .USERNAME ,
187- os_password = fakes .PASSWORD ,
188- os_project_name = fakes .PROJECT_NAME ,
189- os_auth_type = 'v2password' ),
195+ cli_options = FakeOptions (
196+ os_auth_url = fakes .AUTH_URL ,
197+ os_username = fakes .USERNAME ,
198+ os_password = fakes .PASSWORD ,
199+ os_project_name = fakes .PROJECT_NAME ,
200+ os_auth_type = 'v2password' ,
201+ ),
190202 api_version = API_VERSION ,
191203 verify = 'cafile' ,
192204 )
205+ client_manager .setup_auth ()
193206
194207 self .assertFalse (client_manager ._insecure )
195208 self .assertTrue (client_manager ._verify )
@@ -199,10 +212,12 @@ def _select_auth_plugin(self, auth_params, api_version, auth_plugin_name):
199212 auth_params ['os_auth_type' ] = auth_plugin_name
200213 auth_params ['os_identity_api_version' ] = api_version
201214 client_manager = clientmanager .ClientManager (
202- auth_options = FakeOptions (** auth_params ),
215+ cli_options = FakeOptions (** auth_params ),
203216 api_version = API_VERSION ,
204217 verify = True
205218 )
219+ client_manager .setup_auth ()
220+
206221 self .assertEqual (
207222 auth_plugin_name ,
208223 client_manager .auth_plugin_name ,
@@ -228,8 +243,12 @@ def test_client_manager_select_auth_plugin(self):
228243 self ._select_auth_plugin (params , 'XXX' , 'password' )
229244
230245 def test_client_manager_select_auth_plugin_failure (self ):
231- self .assertRaises (exc .CommandError ,
232- clientmanager .ClientManager ,
233- auth_options = FakeOptions (os_auth_plugin = '' ),
234- api_version = API_VERSION ,
235- verify = True )
246+ client_manager = clientmanager .ClientManager (
247+ cli_options = FakeOptions (os_auth_plugin = '' ),
248+ api_version = API_VERSION ,
249+ verify = True ,
250+ )
251+ self .assertRaises (
252+ exc .CommandError ,
253+ client_manager .setup_auth ,
254+ )
0 commit comments