From 129ad390ab1c62a9305f00d9f331f4b935ae83af Mon Sep 17 00:00:00 2001 From: Lance Bragstad Date: Tue, 14 Jun 2016 17:16:28 +0000 Subject: [PATCH] Move TestAuth unscoped token tests to TokenAPITests In test_v3_auth.py, we have a couple different classes that test similar token API behaviors. The TestAuth class is only inherited and tested by the fernet provider where the TokenAPITests class tested with the uuid, fernet, and pki providers. This patch is one of many that will migrate duplicate tests from TestAuth to TokenAPITests. Change-Id: Ia2d7f857d078dde8486df6108009c76e50f353e0 --- keystone/tests/unit/test_v3_auth.py | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/keystone/tests/unit/test_v3_auth.py b/keystone/tests/unit/test_v3_auth.py index 67eaab23a8..1256efa378 100644 --- a/keystone/tests/unit/test_v3_auth.py +++ b/keystone/tests/unit/test_v3_auth.py @@ -233,6 +233,29 @@ class TokenAPITests(object): value, "%s != %s" % (expected, value)) + def test_create_unscoped_token_with_user_id(self): + auth_data = self.build_authentication_request( + user_id=self.user['id'], + password=self.user['password']) + r = self.v3_create_token(auth_data) + self.assertValidUnscopedTokenResponse(r) + + def test_create_unscoped_token_with_user_domain_id(self): + auth_data = self.build_authentication_request( + username=self.user['name'], + user_domain_id=self.domain['id'], + password=self.user['password']) + r = self.v3_create_token(auth_data) + self.assertValidUnscopedTokenResponse(r) + + def test_create_unscoped_token_with_user_domain_name(self): + auth_data = self.build_authentication_request( + username=self.user['name'], + user_domain_name=self.domain['name'], + password=self.user['password']) + r = self.v3_create_token(auth_data) + self.assertValidUnscopedTokenResponse(r) + def test_validate_unscoped_token(self): unscoped_token = self._get_unscoped_token() self._validate_token(unscoped_token) @@ -2625,29 +2648,6 @@ class TestAuthKerberos(TestAuthExternalDomain): class TestAuth(test_v3.RestfulTestCase): - def test_unscoped_token_with_user_id(self): - auth_data = self.build_authentication_request( - user_id=self.user['id'], - password=self.user['password']) - r = self.v3_create_token(auth_data) - self.assertValidUnscopedTokenResponse(r) - - def test_unscoped_token_with_user_domain_id(self): - auth_data = self.build_authentication_request( - username=self.user['name'], - user_domain_id=self.domain['id'], - password=self.user['password']) - r = self.v3_create_token(auth_data) - self.assertValidUnscopedTokenResponse(r) - - def test_unscoped_token_with_user_domain_name(self): - auth_data = self.build_authentication_request( - username=self.user['name'], - user_domain_name=self.domain['name'], - password=self.user['password']) - r = self.v3_create_token(auth_data) - self.assertValidUnscopedTokenResponse(r) - def test_project_id_scoped_token_with_user_id(self): auth_data = self.build_authentication_request( user_id=self.user['id'],