aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorlymanZerga11 <lymanZerga11@users.noreply.github.com>2017-02-13 15:05:29 +0800
committerGitHub <noreply@github.com>2017-02-13 15:05:29 +0800
commit26a17a3d829931999e33f462bdeac488f55f0d4b (patch)
treebf62a30fbc7d4d923e4445a149fb3b517c7bc118 /test
parenta912d67c069cd51f4414471d7618b3c4547aabae (diff)
downloadmitmproxy-26a17a3d829931999e33f462bdeac488f55f0d4b.tar.gz
mitmproxy-26a17a3d829931999e33f462bdeac488f55f0d4b.tar.bz2
mitmproxy-26a17a3d829931999e33f462bdeac488f55f0d4b.zip
Update test_flowlist.py
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/console/test_flowlist.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/mitmproxy/console/test_flowlist.py b/test/mitmproxy/console/test_flowlist.py
index 0d218e75..88895ac8 100644
--- a/test/mitmproxy/console/test_flowlist.py
+++ b/test/mitmproxy/console/test_flowlist.py
@@ -11,8 +11,9 @@ class UrlError(Exception):
pass
-def mock_add_log(message):
- raise UrlError(message)
+def mock_log(message):
+ if "Invalid URL" in message:
+ raise UrlError(message)
class TestFlowlist(tservers.MasterTest):
@@ -22,9 +23,9 @@ class TestFlowlist(tservers.MasterTest):
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)
+ @mock.patch('mitmproxy.tools.console.signals.status_message.send', side_effect = mock_log)
def test_new_request(self, test_func):
m = self.mkmaster()
x = flowlist.FlowListBox(m)
- with pytest.raises(UrlError) as e:
+ with pytest.raises(UrlError):
x.new_request("nonexistent url", "GET")