summaryrefslogtreecommitdiff
path: root/mocker.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2007-12-04 23:56:34 -0200
committerGustavo Niemeyer <gustavo@niemeyer.net>2007-12-04 23:56:34 -0200
commita902346fb27f6e70fe778a8eb3a8adc2145dee08 (patch)
tree14eda8d9269de1d0fe581ca83d32f39d1a30fbb2 /mocker.py
parentdd13d97f602ebb08b0357701a6b22a7441c4abea (diff)
downloadmocker-a902346fb27f6e70fe778a8eb3a8adc2145dee08.tar.gz
Now when a spec is provided (or with proxy/replace/patch) the
existence of the real method is checked even if the mocked method doesn't have to execute (e.g. due to count(0)).
Diffstat (limited to 'mocker.py')
-rw-r--r--mocker.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mocker.py b/mocker.py
index e146ae4..6189ccd 100644
--- a/mocker.py
+++ b/mocker.py
@@ -1780,6 +1780,10 @@ class SpecChecker(Task):
raise AssertionError("Specification is %s%s: %s" %
(self._method.__name__, spec, message))
+ def verify(self):
+ if not self._method:
+ raise AssertionError("Method not found in real specification")
+
def run(self, path):
if not self._method:
raise AssertionError("Method not found in real specification")