Exemplo n.º 1
0
 def test_non_str_endpoint_raises_error(self, *args):
     with self.assertRaisesRegex(
         exceptions.ApiClientConfigurationError,
         'Endpoint URL is not a string, cannot create client'
     ):
         client.validate_client_args(
             [],
             'username',
             'password'
         )
Exemplo n.º 2
0
 def test_none_endpoint_raises_error(self, *args):
     with self.assertRaisesRegex(
         exceptions.ApiClientConfigurationError,
         'Endpoint URL has not been set, cannot create client'
     ):
         client.validate_client_args(
             None,
             'username',
             'password'
         )
Exemplo n.º 3
0
 def test_non_str_password_raises_error(self, *args):
     with self.assertRaisesRegex(
         exceptions.ApiClientConfigurationError,
         'Password is not a string, cannot create client'
     ):
         client.validate_client_args(
             'https://endpoint/',
             'username',
             []
         )
Exemplo n.º 4
0
 def test_none_username_raises_error(self, *args):
     with self.assertRaisesRegex(
         exceptions.ApiClientConfigurationError,
         'Username is not set, cannot create client'
     ):
         client.validate_client_args(
             'https://endpoint/',
             None,
             'password'
         )
Exemplo n.º 5
0
 def test_colon_in_password_raises_error(self, *args):
     with self.assertRaisesRegex(
         exceptions.ApiClientConfigurationError,
         'Password contains ":" character \(illegal in basic auth\), '
         'cannot create client'
     ):
         client.validate_client_args(
             'https://endpoint/',
             'username',
             'pass:word'
         )
Exemplo n.º 6
0
 def test_valid_args_returns_true(self, *args):
     self.assertTrue(
         client.validate_client_args(
             'https://endpoint/',
             'username',
             'password'
         )
     )