diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_script.py | 10 | ||||
-rw-r--r-- | test/mitmproxy/proxy/test_server.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_taddons.py | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py index fad514ae..ea942d34 100644 --- a/test/mitmproxy/addons/test_script.py +++ b/test/mitmproxy/addons/test_script.py @@ -1,3 +1,4 @@ +import asyncio import os import sys import traceback @@ -123,8 +124,13 @@ class TestScript: assert await tctx.master.await_log("Loading") tctx.master.clear() - f.write("\n") - assert await tctx.master.await_log("Loading") + for i in range(20): + f.write("\n") + if tctx.master.has_log("Loading"): + break + await asyncio.sleep(0.1) + else: + raise AssertionError("No reload seen") @pytest.mark.asyncio async def test_exception(self): diff --git a/test/mitmproxy/proxy/test_server.py b/test/mitmproxy/proxy/test_server.py index d7836104..3cb35138 100644 --- a/test/mitmproxy/proxy/test_server.py +++ b/test/mitmproxy/proxy/test_server.py @@ -827,7 +827,7 @@ class TestServerConnect(tservers.HTTPProxyTest): self.set_addons(AFakeResponse()) assert self.pathod("200").status_code == 200 asyncio.sleep(0.1) - assert not self.proxy.tmaster._has_log("serverconnect") + assert not self.proxy.tmaster.has_log("serverconnect") class AKillRequest: diff --git a/test/mitmproxy/test_taddons.py b/test/mitmproxy/test_taddons.py index 39dd65c2..67f64463 100644 --- a/test/mitmproxy/test_taddons.py +++ b/test/mitmproxy/test_taddons.py @@ -10,10 +10,10 @@ from mitmproxy import ctx @pytest.mark.asyncio async def test_recordingmaster(): with taddons.context() as tctx: - assert not tctx.master._has_log("nonexistent") + assert not tctx.master.has_log("nonexistent") assert not tctx.master.has_event("nonexistent") ctx.log.error("foo") - assert not tctx.master._has_log("foo", level="debug") + assert not tctx.master.has_log("foo", level="debug") assert await tctx.master.await_log("foo", level="error") |