PIM testing: fix reference to start time in testActive

Binding _done() to self.start reads the *current* value of self.start
when _done() gets called. We need to bind to an inmuted local instance
instead to achieve the desired effect.
This commit is contained in:
Patrick Ohly 2013-03-26 15:26:24 +01:00
parent e583973999
commit 48b577370f

View file

@ -253,10 +253,11 @@ class Watchdog():
if not self.started:
# Run with a long timeout. We want to know how long it
# takes to reply, even if it is too long.
self.started = time.time()
started = time.time()
self.started = started
self.manager.GetAllPeers(timeout=1000,
reply_handler=lambda peers: self._done(self.started, self.results, None),
error_handler=lambda error: self._done(self.started, self.results, error))
reply_handler=lambda peers: self._done(started, self.results, None),
error_handler=lambda error: self._done(started, self.results, error))
return True
def _done(self, started, results, error):