diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2018-04-23 13:19:20 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2018-04-23 13:19:20 +1200 |
commit | 0ba10b61090274a1f2ca70a8fb1d68830cb44607 (patch) | |
tree | 0dae6d1c8626e2399a31564ff3275149f87580e0 /mitmproxy/test | |
parent | 44016a0de519469792769f7b78c37e7de9bfde24 (diff) | |
download | mitmproxy-0ba10b61090274a1f2ca70a8fb1d68830cb44607.tar.gz mitmproxy-0ba10b61090274a1f2ca70a8fb1d68830cb44607.tar.bz2 mitmproxy-0ba10b61090274a1f2ca70a8fb1d68830cb44607.zip |
addons/script: improve relability of reload test
The granularity of mtime is surprisingly bad. Make the tests more robust
against this, and promote has_log back to a public method, now that we have a
few legitimate examples.
Diffstat (limited to 'mitmproxy/test')
-rw-r--r-- | mitmproxy/test/taddons.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/test/taddons.py b/mitmproxy/test/taddons.py index e0e4fef9..0505f9f7 100644 --- a/mitmproxy/test/taddons.py +++ b/mitmproxy/test/taddons.py @@ -35,7 +35,7 @@ class RecordingMaster(mitmproxy.master.Master): for i in self.logs: print("%s: %s" % (i.level, i.msg), file=outf) - def _has_log(self, txt, level=None): + def has_log(self, txt, level=None): for i in self.logs: if level and i.level != level: continue @@ -45,7 +45,7 @@ class RecordingMaster(mitmproxy.master.Master): async def await_log(self, txt, level=None): for i in range(20): - if self._has_log(txt, level): + if self.has_log(txt, level): return True else: await asyncio.sleep(0.1) |