Merge "Fix decorators of properties in AccessToken"

This commit is contained in:
Jenkins 2015-08-03 01:02:10 +00:00 committed by Gerrit Code Review
commit b2cd977eed
2 changed files with 6 additions and 15 deletions

View File

@ -599,7 +599,7 @@ class AccessInfoV3(AccessInfo):
def username(self):
return self._user['name']
@missingproperty
@property
def _domain(self):
return self._data['token']['domain']
@ -623,7 +623,7 @@ class AccessInfoV3(AccessInfo):
def project_domain_id(self):
return self._project['domain']['id']
@property
@missingproperty
def project_domain_name(self):
return self._project['domain']['name']

View File

@ -62,13 +62,9 @@ class AccessInfoPluginTests(utils.TestCase):
def test_project_auth_properties(self):
plugin = self._plugin()
auth_ref = plugin.auth_ref
self.assertIsNone(auth_ref.project_domain_id)
try:
# NOTE(breton): this is currently failing
self.assertIsNone(auth_ref.project_domain_name)
self.fail()
except KeyError:
pass
self.assertIsNone(auth_ref.project_domain_name)
self.assertIsNone(auth_ref.project_id)
self.assertIsNone(auth_ref.project_name)
@ -76,10 +72,5 @@ class AccessInfoPluginTests(utils.TestCase):
plugin = self._plugin()
auth_ref = plugin.auth_ref
try:
# NOTE(breton): this is currently failing
self.assertIsNone(auth_ref.domain_id)
self.assertIsNone(auth_ref.domain_name)
self.fail()
except TypeError:
pass
self.assertIsNone(auth_ref.domain_id)
self.assertIsNone(auth_ref.domain_name)