diff options
author | lymanZerga11 <lymanZerga11@users.noreply.github.com> | 2017-02-12 23:23:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-12 23:23:23 +0800 |
commit | df8a5aa9bea73472313a5c6785a5957ea6bbdcb6 (patch) | |
tree | a6786ba02ea1ae488c2659e7870d96462743129d /test | |
parent | c622e4a64983aa159b5a0710d86628a366c17dd1 (diff) | |
download | mitmproxy-df8a5aa9bea73472313a5c6785a5957ea6bbdcb6.tar.gz mitmproxy-df8a5aa9bea73472313a5c6785a5957ea6bbdcb6.tar.bz2 mitmproxy-df8a5aa9bea73472313a5c6785a5957ea6bbdcb6.zip |
Update test_flowlist.py
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/console/test_flowlist.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/mitmproxy/console/test_flowlist.py b/test/mitmproxy/console/test_flowlist.py index 861be863..4e05ca14 100644 --- a/test/mitmproxy/console/test_flowlist.py +++ b/test/mitmproxy/console/test_flowlist.py @@ -1,33 +1,31 @@ import mitmproxy.tools.console.flowlist as flowlist -from mitmproxy.test import tutils -from mitmproxy.test import tflow from mitmproxy.tools import console from mitmproxy import proxy from mitmproxy import options -from mitmproxy.tools.console import common from .. import mastertest import pytest from unittest import mock + class ScriptError(Exception): pass + def mock_add_log(message): raise ScriptError(message) + class TestFlowlist(mastertest.MasterTest): def mkmaster(self, **opts): if "verbosity" not in opts: opts["verbosity"] = 1 o = options.Options(**opts) return console.master.ConsoleMaster(o, proxy.DummyServer()) - + @mock.patch('mitmproxy.tools.console.signals.status_message.send', side_effect = mock_add_log) - def test_new_request(self,test_func): + def test_new_request(self, test_func): m = self.mkmaster() x = flowlist.FlowListBox(m) with pytest.raises(ScriptError) as e: x.new_request("nonexistent url", "GET") assert "Invalid URL" in str(e) - - |