转自:http://pmock.sourceforge.net/api/public/pmock.Mock-class.html
Class Mock
object
--+
|
Mock
A mock object.
Method Summary | |
---|---|
__init__(self, name) | |
__getattr__(self, attr_name) | |
add_invokable(self, invokable) | |
Define an expectation for a method. | |
get_name(self) | |
invokables_str(self) | |
invoke(self, invocation) | |
lookup_id(self, builder_id) | |
Return a proxy to the mock object. | |
register_method_name(self, builder_id, builder) | |
register_unique_id(self, builder_id, builder) | |
Set the default behaviour of undefined methods. | |
Define a method that may or may not be called. | |
Check that the mock object has been called as expected. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T |
Method Details |
---|
expects(self, invocation_matcher)Define an expectation for a method.
|
proxy(self)Return a proxy to the mock object. Proxies only have the mocked methods which may be useful if the mock's builder methods are in the way. |
set_default_stub(self, stub)Set the default behaviour of undefined methods. |
stubs(self)Define a method that may or may not be called.
|
verify(self)Check that the mock object has been called as expected. |