Graham Carlyle - 2005-03-20

Logged In: YES
user_id=992618

The version of pmock in CVS does support __call__ ...

class CallableTest(unittest.TestCase):

def test_call_expected(self):
mock = pmock.Mock()
mock.expects(pmock.once()).__call__(pmock.eq("hello"))
mock("hello")
mock.verify()

I intend to release a newer version of pmock but have been
reluctant to until I get the time to think through a few
issues it has, such as supporting properties, more special
methods support, the output format.

To be honest I'm also not entirely certain whether the api
is sufficiently pythonic. The long lines of code that result
from defining an expectation don't seem to sit well with
conventional python formatting.

Added to these issues is the fact that I'm not using it
myself at the moment so I haven't been sufficiently
motivated to move it forward.