diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-10-26 19:56:59 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2017-10-26 21:43:59 +0200 |
commit | 7314081b8232ac8da8f0f893bad065806454c374 (patch) | |
tree | 9e58a3dc11d05bff7000b0bc1fdc9727f09f39f2 /test | |
parent | 671b012e38fa0e3bbda379ac5bf5eab2cfd845e8 (diff) | |
download | mitmproxy-7314081b8232ac8da8f0f893bad065806454c374.tar.gz mitmproxy-7314081b8232ac8da8f0f893bad065806454c374.tar.bz2 mitmproxy-7314081b8232ac8da8f0f893bad065806454c374.zip |
make safecall threadsafe.
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_script.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py index aa7ca68e..c4fe6b43 100644 --- a/test/mitmproxy/addons/test_script.py +++ b/test/mitmproxy/addons/test_script.py @@ -7,6 +7,7 @@ import pytest from mitmproxy import addonmanager from mitmproxy import exceptions +from mitmproxy import log from mitmproxy.addons import script from mitmproxy.test import taddons from mitmproxy.test import tflow @@ -50,7 +51,7 @@ def test_load_fullname(): def test_script_print_stdout(): with taddons.context() as tctx: - with mock.patch('mitmproxy.ctx.log.warn') as mock_warn: + with mock.patch('mitmproxy.ctx.master.tell') as mock_warn: with addonmanager.safecall(): ns = script.load_script( tutils.test_data.path( @@ -58,7 +59,7 @@ def test_script_print_stdout(): ) ) ns.load(addonmanager.Loader(tctx.master)) - mock_warn.assert_called_once_with("stdoutprint") + mock_warn.assert_called_once_with("log", log.LogEntry("stdoutprint", "warn")) class TestScript: |