From d30ef7ee3eb1bef28fc5bddba72ad6ba0cb54660 Mon Sep 17 00:00:00 2001 From: lymanZerga11 Date: Tue, 14 Feb 2017 21:17:18 +0800 Subject: [PATCH] Update test_flowlist.py --- test/mitmproxy/console/test_flowlist.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/mitmproxy/console/test_flowlist.py b/test/mitmproxy/console/test_flowlist.py index 16c5ad075..3bd92e415 100644 --- a/test/mitmproxy/console/test_flowlist.py +++ b/test/mitmproxy/console/test_flowlist.py @@ -3,8 +3,7 @@ from mitmproxy.tools import console from mitmproxy import proxy from mitmproxy import options from .. import tservers -import pytest -from unittest import mock as Mock +from unittest import mock class TestFlowlist(tservers.MasterTest): @@ -17,6 +16,6 @@ class TestFlowlist(tservers.MasterTest): def test_new_request(self): m = self.mkmaster() x = flowlist.FlowListBox(m) - with Mock.patch('mitmproxy.tools.console.signals.status_message.send') as mock: + with mock.patch('mitmproxy.tools.console.signals.status_message.send') as mock_thing: x.new_request("nonexistent url", "GET") - mock.assert_called_once_with(message = "Invalid URL: No hostname given") + mock_thing.assert_called_once_with(message="Invalid URL: No hostname given")