mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
Update test_flowlist.py
This commit is contained in:
parent
f5b30b8872
commit
577fb818b9
@ -7,12 +7,12 @@ import pytest
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
|
||||||
class ScriptError(Exception):
|
class UrlError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def mock_add_log(message):
|
def mock_add_log(message):
|
||||||
raise ScriptError(message)
|
raise UrlError(message)
|
||||||
|
|
||||||
|
|
||||||
class TestFlowlist(tservers.MasterTest):
|
class TestFlowlist(tservers.MasterTest):
|
||||||
@ -26,6 +26,6 @@ class TestFlowlist(tservers.MasterTest):
|
|||||||
def test_new_request(self, test_func):
|
def test_new_request(self, test_func):
|
||||||
m = self.mkmaster()
|
m = self.mkmaster()
|
||||||
x = flowlist.FlowListBox(m)
|
x = flowlist.FlowListBox(m)
|
||||||
with pytest.raises(ScriptError) as e:
|
with pytest.raises(UrlError) as e:
|
||||||
x.new_request("nonexistent url", "GET")
|
x.new_request("nonexistent url", "GET")
|
||||||
assert "Invalid URL" in str(e)
|
assert "Invalid URL" in str(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user