PEP8/style cleanup.
Also unblocks Jenkins. Change-Id: I76e401e7154714448911c77e08e7c9d18d8734e9
This commit is contained in:
parent
629453f41e
commit
dcae1d7643
@ -52,18 +52,19 @@ wsgi.WSGIRequest.__repr__ = lambda self: "<class 'django.http.HttpRequest'>"
|
|||||||
|
|
||||||
def create_stubs(stubs_to_create={}):
|
def create_stubs(stubs_to_create={}):
|
||||||
if not isinstance(stubs_to_create, dict):
|
if not isinstance(stubs_to_create, dict):
|
||||||
raise TypeError, ("create_stub must be passed a dict, but a %s was " \
|
raise TypeError("create_stub must be passed a dict, but a %s was "
|
||||||
"given." % type(stubs_to_create).__name__)
|
"given." % type(stubs_to_create).__name__)
|
||||||
|
|
||||||
def inner_stub_out(fn):
|
def inner_stub_out(fn):
|
||||||
@wraps(fn)
|
@wraps(fn)
|
||||||
def instance_stub_out(self):
|
def instance_stub_out(self):
|
||||||
for key in stubs_to_create:
|
for key in stubs_to_create:
|
||||||
if not (isinstance(stubs_to_create[key], tuple) or \
|
if not (isinstance(stubs_to_create[key], tuple) or
|
||||||
isinstance(stubs_to_create[key], list)):
|
isinstance(stubs_to_create[key], list)):
|
||||||
raise TypeError, ("The values of the create_stub " \
|
raise TypeError("The values of the create_stub "
|
||||||
"dict must be lists or tuples, but is a %s." %
|
"dict must be lists or tuples, but "
|
||||||
type(stubs_to_create[key]).__name__)
|
"is a %s."
|
||||||
|
% type(stubs_to_create[key]).__name__)
|
||||||
|
|
||||||
for value in stubs_to_create[key]:
|
for value in stubs_to_create[key]:
|
||||||
self.mox.StubOutWithMock(key, value)
|
self.mox.StubOutWithMock(key, value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user