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
This commit is contained in:
Lance Bragstad 2016-06-14 17:16:28 +00:00
parent dae2e928bf
commit 129ad390ab

View File

@ -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'],