Merge "clean up invalid variable reference"

This commit is contained in:
Jenkins 2013-04-23 18:07:22 +00:00 committed by Gerrit Code Review
commit eefc8e0473
2 changed files with 13 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class AuthInfo(object):
""" """
if method not in self.auth['identity']['methods']: if method not in self.auth['identity']['methods']:
raise exception.ValidationError(attribute=method_name, raise exception.ValidationError(attribute=method,
target='identity') target='identity')
return self.auth['identity'][method] return self.auth['identity'][method]

View File

@ -83,6 +83,18 @@ class TestAuthInfo(test_v3.RestfulTestCase):
None, None,
auth_data) auth_data)
def test_get_method_data_invalid_method(self):
auth_data = self.build_authentication_request(
user_id='test',
password='test')['auth']
context = None
auth_info = auth.controllers.AuthInfo(context, auth_data)
method_name = uuid.uuid4().hex
self.assertRaises(exception.ValidationError,
auth_info.get_method_data,
method_name)
class TestTokenAPIs(test_v3.RestfulTestCase): class TestTokenAPIs(test_v3.RestfulTestCase):
def setUp(self): def setUp(self):