def test_sso_enabled_site(self, *mocks):
     """
     Ensure that an exception is thrown should we attempt console authentication
     on an SSO-enabled site.
     """
     handler = console_authentication.ConsoleLoginHandler(fixed_host=False)
     with self.assertRaises(ConsoleLoginWithSSONotSupportedError):
         handler._get_user_credentials(None, None)
 def test_sso_enabled_site_with_legacy_exception_name(self, *mocks):
     """
     Ensure that an exception is thrown should we attempt console authentication
     on an SSO-enabled site. We use the legacy exception-name to ensure backward
     compatibility with older code.
     """
     handler = console_authentication.ConsoleLoginHandler(fixed_host=False)
     with self.assertRaises(ConsoleLoginWithSSONotSupportedError):
         handler._get_user_credentials(None, None, None)
Пример #3
0
 def test_console_auth_with_whitespace(self, *mocks):
     """
     Makes sure that authentication strips whitespaces on the command line.
     """
     handler = console_authentication.ConsoleLoginHandler(fixed_host=False)
     self.assertEqual(
         handler._get_user_credentials(None, None, None),
         ("https://test.shotgunstudio.com", "username", " password "))
     self.assertEqual(handler._get_2fa_code(), "2fa code")