@@ -178,7 +178,6 @@ def test_from_json_file_with_sessionID(self, mock_open, mock_login):
178178
179179 self .assertIsInstance (oneview_client , OneViewClient )
180180 self .assertEqual ("172.16.102.59" , oneview_client .connection .get_host ())
181- self .assertEqual ("123" , oneview_client .connection .get_session_id ())
182181
183182 @mock .patch .object (connection , 'login' )
184183 @mock .patch (mock_builtin ('open' ))
@@ -223,7 +222,8 @@ def test_from_minimal_environment_variables(self, mock_set_proxy, mock_login):
223222
224223 mock_login .assert_called_once_with (dict (userName = 'admin' ,
225224 password = 'secret123' ,
226- authLoginDomain = '' ))
225+ authLoginDomain = '' ,
226+ sessionID = '' ))
227227 mock_set_proxy .assert_not_called ()
228228 self .assertEqual (300 , oneview_client .connection ._apiVersion )
229229
@@ -233,7 +233,10 @@ def test_from_minimal_environment_variables(self, mock_set_proxy, mock_login):
233233 def test_from_minimal_environment_variables_with_sessionID (self , mock_set_proxy , mock_login ):
234234 oneview_client = OneViewClient .from_environment_variables ()
235235
236- mock_login .assert_called_once_with (dict (sessionID = '123' ))
236+ mock_login .assert_called_once_with (dict (userName = '' ,
237+ password = '' ,
238+ authLoginDomain = '' ,
239+ sessionID = '123' ))
237240 mock_set_proxy .assert_not_called ()
238241 self .assertEqual (300 , oneview_client .connection ._apiVersion )
239242
@@ -245,7 +248,8 @@ def test_from_full_environment_variables(self, mock_set_proxy, mock_login):
245248
246249 mock_login .assert_called_once_with (dict (userName = 'admin' ,
247250 password = 'secret123' ,
248- authLoginDomain = 'authdomain' ))
251+ authLoginDomain = 'authdomain' ,
252+ sessionID = '' ))
249253 mock_set_proxy .assert_called_once_with ('172.16.100.195' , 9999 )
250254
251255 self .assertEqual (201 , oneview_client .connection ._apiVersion )
@@ -260,11 +264,11 @@ def test_from_full_environment_variables_with_sessionID(self, mock_set_proxy, mo
260264
261265 mock_login .assert_called_once_with (dict (userName = 'admin' ,
262266 password = 'secret123' ,
267+ authLoginDomain = '' ,
263268 sessionID = '123' ))
264269 mock_set_proxy .assert_called_once_with ('172.16.100.195' , 9999 )
265270
266271 self .assertEqual (201 , oneview_client .connection ._apiVersion )
267- self .assertEqual ("123" , oneview_client .connection .get_session_id ())
268272 self .assertEqual (oneview_client .create_image_streamer_client ().connection .get_host (),
269273 OS_ENVIRON_CONFIG_FULL_WITH_SESSIONID ['ONEVIEWSDK_IMAGE_STREAMER_IP' ])
270274
@@ -278,9 +282,10 @@ def test_from_environment_variables_is_passing_right_arguments_to_the_constructo
278282 'ip' : '172.16.100.199' ,
279283 'image_streamer_ip' : '172.172.172.172' ,
280284 'credentials' :
281- {'password' : 'secret123' ,
285+ {'userName' : 'admin' ,
286+ 'password' : 'secret123' ,
282287 'authLoginDomain' : 'authdomain' ,
283- 'userName ' : 'admin ' }})
288+ 'sessionID ' : '' }})
284289
285290 @mock .patch .dict ('os.environ' , OS_ENVIRON_CONFIG_FULL_WITH_SESSIONID )
286291 @mock .patch .object (OneViewClient , '__init__' )
@@ -292,8 +297,9 @@ def test_from_environment_variables_is_passing_right_arguments_to_the_constructo
292297 'ip' : '172.16.100.199' ,
293298 'image_streamer_ip' : '172.172.172.172' ,
294299 'credentials' :
295- {'password' : 'secret123' ,
296- 'userName' : 'admin' ,
300+ {'userName' : 'admin' ,
301+ 'password' : 'secret123' ,
302+ 'authLoginDomain' : '' ,
297303 'sessionID' : '123' }})
298304
299305 @mock .patch .object (connection , 'login' )
0 commit comments