diff options
author | Erik Johnston <erik@matrix.org> | 2016-10-11 14:08:29 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-10-11 14:08:29 +0100 |
commit | 3061dac53eef21110d8d9f08554f28c562175a18 (patch) | |
tree | 51a8cb5ed3f294887bdcc2d6ef36efcad186af07 /tests/utils.py | |
parent | Fix check of wrong variable (diff) | |
parent | Merge pull request #1166 from matrix-org/rav/grandfather_broken_riot_signup (diff) | |
download | synapse-3061dac53eef21110d8d9f08554f28c562175a18.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/replication_noop
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/utils.py b/tests/utils.py index 915b934e94..92d470cb48 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -220,6 +220,7 @@ class MockClock(object): # list of lists of [absolute_time, callback, expired] in no particular # order self.timers = [] + self.loopers = [] def time(self): return self.now @@ -240,7 +241,7 @@ class MockClock(object): return t def looping_call(self, function, interval): - pass + self.loopers.append([function, interval / 1000., self.now]) def cancel_call_later(self, timer, ignore_errs=False): if timer[2]: @@ -269,6 +270,12 @@ class MockClock(object): else: self.timers.append(t) + for looped in self.loopers: + func, interval, last = looped + if last + interval < self.now: + func() + looped[2] = self.now + def advance_time_msec(self, ms): self.advance_time(ms / 1000.) |