fixed exception type; full coverage on view

This commit is contained in:
madt1m 2018-06-13 17:39:46 +02:00
parent 40faf2c662
commit af54c26014
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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():