pMock has not been under active development since mid 2004.
For other suitable mocking frameworks see the Cheescake info on python mock testing tools
pMock is a Python module for testing Python code using mock objects.
...
import pmock
...
class InstrumentTest(unittest.TestCase):
def test_low_quality_analysis(self):
analyser_mock = pmock.Mock()
analyser_mock.expects().analyse(pmock.eq("123")).will(pmock.return_value("30"))
instrument = Instrument(analyser_mock)
instrument.insert("sample#123")
self.assert_(instrument.is_low_quality_indicator_on())
analyser_mock.verify()
...
Inspired by the Java jMock library, pMock makes the writing of unit tests using mock object techniques easier.
The typical sequence of steps in a test involving pMock mock objects are:Bitbucket project page
Author: Graham Carlyle (grahamcarlyle at graham carlyle dot com)