Fix some pep8 error

Change-Id: I805bed4b74a9ea94d38fc9c197920d4fb0377139
This commit is contained in:
zhurong 2019-01-02 14:20:18 +08:00
parent 8a42ca497f
commit fd531abac3
3 changed files with 6 additions and 6 deletions

View File

@ -91,8 +91,8 @@ class FakeHTTPClient(client.HTTPClient):
"""Assert than an API method was just called."""
expected = (method, url)
called = self.callstack[pos][0:2]
assert (self.callstack,
"Expected %s %s but no calls were made." % expected)
assert self.callstack, \
"Expected %s %s but no calls were made." % expected
assert expected == called, 'Expected %s %s; got %s %s' % (
expected + called)
@ -106,8 +106,8 @@ class FakeHTTPClient(client.HTTPClient):
"""Assert than an API method was called anytime in the test."""
expected = (method, url)
assert (self.callstack,
"Expected %s %s but no calls were made." % expected)
assert self.callstack, \
"Expected %s %s but no calls were made." % expected
found = False
entry = None

View File

@ -186,7 +186,7 @@ class KeystoneAuthPlugin(auth.BaseAuthPlugin):
# retrieve session
ks_session = _get_keystone_session(**ks_kwargs)
token = lambda: ks_session.get_token()
token = ks_session.get_token()
endpoint = (self.opts.get('endpoint') or
_get_endpoint(ks_session, **ks_kwargs))
self.opts['token'] = token

View File

@ -172,7 +172,7 @@ class PlanManagerTest(base.TestCase):
def test_plan_create_post_success(self):
api_client = mock.MagicMock()
dummy_data = 'version: 1\nname: ex_plan1\ndescription: dsc1.'
response = lambda: None
response = mock.MagicMock()
setattr(response, 'content', dummy_data)
api_client.post.return_value = response
try: