@@ -243,7 +243,7 @@ def test_login_device_minimal_sso_configuration(self):
243243 )
244244
245245 def test_login_device_partially_missing_sso_configuration (self ):
246- content = '[default]\n ' 'sso_start_url =%s\n ' % self .start_url
246+ content = '[default]\n sso_start_url =%s\n ' % self .start_url
247247 self .set_config_file_content (content = content )
248248 _ , stderr , _ = self .run_cmd (
249249 'sso login --use-device-code' , expected_rc = 253
@@ -332,6 +332,17 @@ def test_login_device_sso_with_explicit_sso_session_arg(self):
332332 expected_token = self .access_token ,
333333 )
334334
335+ def test_login_auth_sso_with_explicit_redirect_port (self ):
336+ content = self .get_sso_session_config ('test-session' )
337+ self .set_config_file_content (content = content )
338+ self .add_oidc_auth_code_responses (self .access_token )
339+ self .run_cmd (
340+ 'sso login --redirect-port 5050 --redirect-host 50.50.50.50'
341+ )
342+ self .assert_auth_code_fetcher_called_with (
343+ server_address = ('50.50.50.50' , '5050' )
344+ )
345+
335346 def test_login_auth_sso_with_explicit_sso_session_arg (self ):
336347 content = self .get_sso_session_config (
337348 'test-session' , include_profile = False
@@ -404,15 +415,15 @@ def test_login_auth_sso_session_with_scopes(self):
404415 self .assertEqual (params .get ('scopes' ), self .registration_scopes )
405416
406417 def test_login_sso_session_missing_config (self ):
407- content = '[default]\n ' 'sso_session =test\n ' ' [sso-session test]\n '
418+ content = '[default]\n sso_session =test\n [sso-session test]\n '
408419 self .set_config_file_content (content = content )
409420 _ , stderr , _ = self .run_cmd ('sso login' , expected_rc = 253 )
410421 self .assertIn (
411422 'SSO configuration values: sso_start_url, sso_region' , stderr
412423 )
413424
414425 def test_login_sso_session_missing (self ):
415- content = '[default]\n ' 'sso_session =test\n '
426+ content = '[default]\n sso_session =test\n '
416427 self .set_config_file_content (content = content )
417428 _ , stderr , _ = self .run_cmd ('sso login' , expected_rc = 253 )
418429 self .assertIn ('sso-session does not exist: "test"' , stderr )
0 commit comments