diff options
Diffstat (limited to 'mitmproxy/test/taddons.py')
-rw-r--r-- | mitmproxy/test/taddons.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mitmproxy/test/taddons.py b/mitmproxy/test/taddons.py index 82a935d2..5cef80f1 100644 --- a/mitmproxy/test/taddons.py +++ b/mitmproxy/test/taddons.py @@ -1,4 +1,5 @@ import contextlib +import asyncio import sys import mitmproxy.master @@ -42,6 +43,14 @@ class RecordingMaster(mitmproxy.master.Master): return True return False + async def await_log(self, txt, level=None): + for i in range(20): + if self.has_log(txt, level): + return True + else: + await asyncio.sleep(0.1) + return False + def has_event(self, name): for i in self.events: if i[0] == name: |