diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2018-04-02 17:53:28 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2018-04-07 08:59:08 +1200 |
commit | cdbe6f97af6ae86f80080b7a279c8d3734662c5c (patch) | |
tree | cdbe781e417e7a049ec05be644013842535f3c66 /test | |
parent | 506ccc5693284a66ff186306509217282868e48b (diff) | |
download | mitmproxy-cdbe6f97af6ae86f80080b7a279c8d3734662c5c.tar.gz mitmproxy-cdbe6f97af6ae86f80080b7a279c8d3734662c5c.tar.bz2 mitmproxy-cdbe6f97af6ae86f80080b7a279c8d3734662c5c.zip |
asyncio: remove last vestiage of channel input from master
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_script.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py index 79fa22dc..5427c788 100644 --- a/test/mitmproxy/addons/test_script.py +++ b/test/mitmproxy/addons/test_script.py @@ -2,6 +2,7 @@ import os import sys import traceback from unittest import mock +import time import pytest @@ -49,17 +50,15 @@ def test_load_fullname(): assert not hasattr(ns2, "addons") -def test_script_print_stdout(): +@pytest.mark.asyncio +async def test_script_print_stdout(): with taddons.context() as tctx: - with mock.patch('mitmproxy.ctx.master.tell') as mock_warn: - with addonmanager.safecall(): - ns = script.load_script( - tutils.test_data.path( - "mitmproxy/data/addonscripts/print.py" - ) - ) - ns.load(addonmanager.Loader(tctx.master)) - mock_warn.assert_called_once_with("log", log.LogEntry("stdoutprint", "warn")) + with addonmanager.safecall(): + ns = script.load_script( + tutils.test_data.path("mitmproxy/data/addonscripts/print.py") + ) + ns.load(addonmanager.Loader(tctx.master)) + assert tctx.master.has_log("stdoutprint") class TestScript: |