pep8 cleanups after the rebase

This commit is contained in:
Christopher MacGown 2011-08-07 10:59:11 -07:00 committed by termie
parent 39291fe0e8
commit 2d785404ed
2 changed files with 18 additions and 15 deletions

View File

@ -12,9 +12,11 @@ from tests import utils
class AuthenticateAgainstKeystoneTests(utils.TestCase):
def test_authenticate_success(self):
cs = client.Client("username", "apikey", "project_id", "auth_url/v2.0")
resp = {"auth": {"token": {"expires": "12345", "id": "FAKE_ID"},
resp = {"auth":
{"token": {"expires": "12345", "id": "FAKE_ID"},
"serviceCatalog": {
"nova": [{"adminURL": "http://localhost:8774/v1.1",
"nova": [
{"adminURL": "http://localhost:8774/v1.1",
"region": "RegionOne",
"internalURL": "http://localhost:8774/v1.1",
"publicURL": "http://localhost:8774/v1.1/"}]}}}
@ -23,7 +25,8 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
"body": json.dumps(resp),
})
mock_request = mock.Mock(return_value=(auth_response, json.dumps(resp)))
mock_request = mock.Mock(return_value=(auth_response,
json.dumps(resp)))
@mock.patch.object(httplib2.Http, "request", mock_request)
def test_auth_call():
@ -45,7 +48,6 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
test_auth_call()
def test_authenticate_failure(self):
cs = client.Client("username", "apikey", "project_id", "auth_url/v2.0")
resp = {"unauthorized": {"message": "Unauthorized", "code": "401"}}
@ -54,7 +56,8 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
"body": json.dumps(resp),
})
mock_request = mock.Mock(return_value=(auth_response, json.dumps(resp)))
mock_request = mock.Mock(return_value=(auth_response,
json.dumps(resp)))
@mock.patch.object(httplib2.Http, "request", mock_request)
def test_auth_call():