diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_allowremote.py | 3 | ||||
-rw-r--r-- | test/mitmproxy/addons/test_clientplayback.py | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/test/mitmproxy/addons/test_allowremote.py b/test/mitmproxy/addons/test_allowremote.py index 9fc71525..52dae68d 100644 --- a/test/mitmproxy/addons/test_allowremote.py +++ b/test/mitmproxy/addons/test_allowremote.py @@ -19,8 +19,7 @@ from mitmproxy.test import taddons ]) def test_allowremote(allow_remote, ip, should_be_killed): ar = allowremote.AllowRemote() - with taddons.context() as tctx: - tctx.master.addons.register(ar) + with taddons.context(ar) as tctx: tctx.options.allow_remote = allow_remote with mock.patch('mitmproxy.proxy.protocol.base.Layer') as layer: diff --git a/test/mitmproxy/addons/test_clientplayback.py b/test/mitmproxy/addons/test_clientplayback.py index 3f990668..f172af83 100644 --- a/test/mitmproxy/addons/test_clientplayback.py +++ b/test/mitmproxy/addons/test_clientplayback.py @@ -24,7 +24,7 @@ class MockThread(): class TestClientPlayback: def test_playback(self): cp = clientplayback.ClientPlayback() - with taddons.context() as tctx: + with taddons.context(cp) as tctx: assert cp.count() == 0 f = tflow.tflow(resp=True) cp.start_replay([f]) @@ -58,7 +58,7 @@ class TestClientPlayback: def test_load_file(self, tmpdir): cp = clientplayback.ClientPlayback() - with taddons.context(): + with taddons.context(cp): fpath = str(tmpdir.join("flows")) tdump(fpath, [tflow.tflow(resp=True)]) cp.load_file(fpath) @@ -68,7 +68,7 @@ class TestClientPlayback: def test_configure(self, tmpdir): cp = clientplayback.ClientPlayback() - with taddons.context() as tctx: + with taddons.context(cp) as tctx: path = str(tmpdir.join("flows")) tdump(path, [tflow.tflow()]) tctx.configure(cp, client_replay=[path]) |