Add a test case for invalid project id being specified.
@@ -536,7 +536,7 @@ class OpenStackIdentity_3_0_Connection_OIDC_access_token_project_idTests(
domain_name='project_id2')
self.auth_instance.auth_token = 'mock'
- def test_authenticate(self):
+ def test_authenticate_valid_project_id(self):
auth = OpenStackIdentity_3_0_Connection_OIDC_access_token(auth_url='http://none',
user_id='idp',
key='token',
@@ -545,6 +545,17 @@ class OpenStackIdentity_3_0_Connection_OIDC_access_token_project_idTests(
domain_name='project_id2')
auth.authenticate()
+ def test_authenticate_invalid_project_id(self):
+ auth = OpenStackIdentity_3_0_Connection_OIDC_access_token(auth_url='http://none',
+ user_id='idp',
+ key='token',
+ token_scope='project',
+ tenant_name="oidc",
+ domain_name='project_id100')
+
+ expected_msg = 'Project project_id100 not found'
+ self.assertRaisesRegex(ValueError, expected_msg, auth.authenticate)
+
class OpenStackIdentity_2_0_Connection_VOMSTests(unittest.TestCase):
def setUp(self):
