Fix the leading indentation issue.
This commit is contained in:
parent
24bd40737a
commit
1a99638ba2
36
mox3/mox.py
36
mox3/mox.py
|
@ -90,8 +90,8 @@ class ExpectedMethodCallsError(Error):
|
|||
"""Init exception.
|
||||
|
||||
Args:
|
||||
# expected_methods: A sequence of MockMethod objects that should have
|
||||
# been called.
|
||||
# expected_methods: A sequence of MockMethod objects that should
|
||||
# have been called.
|
||||
expected_methods: [MockMethod]
|
||||
|
||||
Raises:
|
||||
|
@ -112,16 +112,16 @@ class ExpectedMethodCallsError(Error):
|
|||
class UnexpectedMethodCallError(Error):
|
||||
"""Raised when an unexpected method is called.
|
||||
|
||||
This can occur if a method is called with incorrect parameters, or out of the
|
||||
specified order.
|
||||
This can occur if a method is called with incorrect parameters, or out of
|
||||
the specified order.
|
||||
"""
|
||||
|
||||
def __init__(self, unexpected_method, expected):
|
||||
"""Init exception.
|
||||
|
||||
Args:
|
||||
# unexpected_method: MockMethod that was called but was not at the head
|
||||
# of the expected_method queue.
|
||||
# unexpected_method: MockMethod that was called but was not at the
|
||||
# head of the expected_method queue.
|
||||
# expected: MockMethod or UnorderedGroup the method should have
|
||||
# been in.
|
||||
unexpected_method: MockMethod
|
||||
|
@ -135,7 +135,8 @@ class UnexpectedMethodCallError(Error):
|
|||
differ = difflib.Differ()
|
||||
diff = differ.compare(str(unexpected_method).splitlines(True),
|
||||
str(expected).splitlines(True))
|
||||
self._str = ("Unexpected method call. unexpected:- expected:+\n%s"
|
||||
self._str = ("Unexpected method call."
|
||||
" unexpected:- expected:+\n%s"
|
||||
% ("\n".join(line.rstrip() for line in diff),))
|
||||
|
||||
def __str__(self):
|
||||
|
@ -149,8 +150,8 @@ class UnknownMethodCallError(Error):
|
|||
"""Init exception.
|
||||
|
||||
Args:
|
||||
# unknown_method_name: Method call that is not part of the mocked class's
|
||||
# public interface.
|
||||
# unknown_method_name: Method call that is not part of the mocked
|
||||
# class's public interface.
|
||||
unknown_method_name: str
|
||||
"""
|
||||
|
||||
|
@ -158,8 +159,8 @@ class UnknownMethodCallError(Error):
|
|||
self._unknown_method_name = unknown_method_name
|
||||
|
||||
def __str__(self):
|
||||
return "Method called is not a member of the object: %s" % \
|
||||
self._unknown_method_name
|
||||
return ("Method called is not a member of the object: %s" %
|
||||
self._unknown_method_name)
|
||||
|
||||
|
||||
class PrivateAttributeError(Error):
|
||||
|
@ -172,8 +173,8 @@ class PrivateAttributeError(Error):
|
|||
self._attr = attr
|
||||
|
||||
def __str__(self):
|
||||
return ("Attribute '%s' is private and should not be available in a mock "
|
||||
"object." % self._attr)
|
||||
return ("Attribute '%s' is private and should not be available"
|
||||
"in a mock object." % self._attr)
|
||||
|
||||
|
||||
class ExpectedMockCreationError(Error):
|
||||
|
@ -249,10 +250,11 @@ class Mox(object):
|
|||
Args:
|
||||
# class_to_mock: the class to be mocked
|
||||
class_to_mock: class
|
||||
attrs: dict of attribute names to values that will be set on the mock
|
||||
object. Only public attributes may be set.
|
||||
bounded_to: optionally, when class_to_mock is not a class, it points
|
||||
to a real class object, to which attribute is bound
|
||||
attrs: dict of attribute names to values that will be
|
||||
set on the mock object. Only public attributes may be set.
|
||||
bounded_to: optionally, when class_to_mock is not a class,
|
||||
it points to a real class object, to which
|
||||
attribute is bound
|
||||
|
||||
Returns:
|
||||
MockObject that can be used as the class_to_mock would be.
|
||||
|
|
Loading…
Reference in New Issue