mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
fixed exception type; full coverage on view
This commit is contained in:
parent
40faf2c662
commit
af54c26014
@ -300,7 +300,7 @@ class View(collections.Sequence):
|
||||
if f:
|
||||
filt = flowfilter.parse(f)
|
||||
if not filt:
|
||||
raise exceptions.OptionsError(
|
||||
raise exceptions.CommandError(
|
||||
"Invalid interception filter: %s" % f
|
||||
)
|
||||
self.set_filter(filt)
|
||||
|
@ -123,6 +123,9 @@ def test_filter():
|
||||
v.toggle_marked()
|
||||
assert len(v) == 4
|
||||
|
||||
with pytest.raises(exceptions.CommandError):
|
||||
v.set_filter_cmd("~notafilter regex")
|
||||
|
||||
v[1].marked = True
|
||||
v.toggle_marked()
|
||||
assert len(v) == 1
|
||||
@ -320,6 +323,8 @@ def test_order():
|
||||
|
||||
v.set_reversed(False)
|
||||
assert [i.request.timestamp_start for i in v] == [1, 2, 3, 4]
|
||||
with pytest.raises(exceptions.CommandError):
|
||||
v.set_order("not_an_order")
|
||||
|
||||
|
||||
def test_reversed():
|
||||
|
Loading…
Reference in New Issue
Block a user