aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/console/test_flowlist.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/mitmproxy/console/test_flowlist.py b/test/mitmproxy/console/test_flowlist.py
new file mode 100644
index 00000000..3bd92e41
--- /dev/null
+++ b/test/mitmproxy/console/test_flowlist.py
@@ -0,0 +1,21 @@
+import mitmproxy.tools.console.flowlist as flowlist
+from mitmproxy.tools import console
+from mitmproxy import proxy
+from mitmproxy import options
+from .. import tservers
+from unittest import mock
+
+
+class TestFlowlist(tservers.MasterTest):
+ def mkmaster(self, **opts):
+ if "verbosity" not in opts:
+ opts["verbosity"] = 1
+ o = options.Options(**opts)
+ return console.master.ConsoleMaster(o, proxy.DummyServer())
+
+ def test_new_request(self):
+ m = self.mkmaster()
+ x = flowlist.FlowListBox(m)
+ with mock.patch('mitmproxy.tools.console.signals.status_message.send') as mock_thing:
+ x.new_request("nonexistent url", "GET")
+ mock_thing.assert_called_once_with(message="Invalid URL: No hostname given")