Module pmock :: Class Mock
[show private | hide private]
[frames | no frames]

Class Mock

object --+
         |
        Mock


A mock object.
Method Summary
  __init__(self, name)
  __getattr__(self, attr_name)
  add_invokable(self, invokable)
  expects(self, invocation_matcher)
Define an expectation for a method.
  get_name(self)
  invokables_str(self)
  invoke(self, invocation)
  lookup_id(self, builder_id)
  proxy(self)
Return a proxy to the mock object.
  register_method_name(self, builder_id, builder)
  register_unique_id(self, builder_id, builder)
  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.
  _get_match_order_invokables(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from type
  __new__(T, S, ...)
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.
Returns:
InvocationMocker

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.
Returns:
InvocationMocker

verify(self)

Check that the mock object has been called as expected.

Generated by Epydoc 2.0 on Sun Jul 25 19:39:43 2004 http://epydoc.sf.net