diff options
author | Gustavo Niemeyer <gustavo@niemeyer.net> | 2007-11-23 22:32:35 -0200 |
---|---|---|
committer | Gustavo Niemeyer <gustavo@niemeyer.net> | 2007-11-23 22:32:35 -0200 |
commit | 69601864749f57715559840ba882e1bc4b1c2517 (patch) | |
tree | c1cb7d4fd6f9a37f952254de2b3b0f2b38a3dd8c /mocker.py | |
parent | 9720788795c5cbef10106103a3260a14a6646e65 (diff) | |
download | mocker-69601864749f57715559840ba882e1bc4b1c2517.tar.gz |
Introduced automatic test coverage verification, and covered the
few statements which were not being passed through.
Diffstat (limited to 'mocker.py')
-rw-r--r-- | mocker.py | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -39,7 +39,7 @@ class expect(object): """This is a simple helper that allows a different call-style. With this class one can comfortably do chaining of calls to the - mocker object responsible by the object being handler. For instance:: + mocker object responsible by the object being handled. For instance:: expect(obj.attr).result(3).count(1, 2) @@ -282,15 +282,6 @@ class classinstancemethod(object): return bound_method -class State(object): - - def __init__(self, name): - self._name = name - - def __repr__(self): - return self._name - - class MockerBase(object): """Controller of mock objects. @@ -1602,6 +1593,7 @@ class RunCounter(Task): raise AssertionError("Performed less times than expected.") raise AssertionError("Performed more times than expected.") + class ImplicitRunCounter(RunCounter): """RunCounter inserted by default on any event. @@ -1806,7 +1798,7 @@ def global_replace(remove, install): for referrer in gc.get_referrers(remove): if (type(referrer) is dict and referrer.get("__mocker_replace__", True)): - for key, value in referrer.iteritems(): + for key, value in referrer.items(): if value is remove: referrer[key] = install |