diff options
author | Aldo Cortesi <aldo@corte.si> | 2018-05-12 12:09:48 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2018-05-12 12:35:24 +1200 |
commit | 88fe26997c9da8200722f900992fe1e6f021b34a (patch) | |
tree | ca9f82e048b9116395291a4a7aefd9db704c155f /test | |
parent | 260f7290922a013274d701cec2601648f71c4d59 (diff) | |
download | mitmproxy-88fe26997c9da8200722f900992fe1e6f021b34a.tar.gz mitmproxy-88fe26997c9da8200722f900992fe1e6f021b34a.tar.bz2 mitmproxy-88fe26997c9da8200722f900992fe1e6f021b34a.zip |
script: revamp ephemeral script running
Fixes 2838
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_script.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py index 573b36e7..05472d9a 100644 --- a/test/mitmproxy/addons/test_script.py +++ b/test/mitmproxy/addons/test_script.py @@ -173,16 +173,14 @@ class TestCutTraceback: class TestScriptLoader: @pytest.mark.asyncio async def test_script_run(self, tdata): - rp = tdata.path( - "mitmproxy/data/addonscripts/recorder/recorder.py" - ) + rp = tdata.path("mitmproxy/data/addonscripts/recorder/recorder.py") sc = script.ScriptLoader() with taddons.context(sc) as tctx: sc.script_run([tflow.tflow(resp=True)], rp) await tctx.master.await_log("recorder response") debug = [i.msg for i in tctx.master.logs if i.level == "debug"] assert debug == [ - 'recorder load', 'recorder running', 'recorder configure', + 'recorder running', 'recorder configure', 'recorder requestheaders', 'recorder request', 'recorder responseheaders', 'recorder response' ] @@ -192,7 +190,7 @@ class TestScriptLoader: sc = script.ScriptLoader() with taddons.context(sc) as tctx: sc.script_run([tflow.tflow(resp=True)], "/") - assert await tctx.master.await_log("/: No such script") + assert await tctx.master.await_log("No such script") def test_simple(self, tdata): sc = script.ScriptLoader() |