mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
view: show a message if we remove more than one flow from view
This commit is contained in:
parent
56eb0441da
commit
88832f92a3
@ -389,6 +389,8 @@ class View(collections.Sequence):
|
||||
self.sig_view_remove.send(self, flow=f)
|
||||
del self._store[f.id]
|
||||
self.sig_store_remove.send(self, flow=f)
|
||||
if len(flows) > 1:
|
||||
ctx.log.alert("Removed %s flows" % len(flows))
|
||||
|
||||
@command.command("view.resolve")
|
||||
def resolve(self, spec: str) -> typing.Sequence[mitmproxy.flow.Flow]:
|
||||
|
@ -262,6 +262,16 @@ def test_duplicate():
|
||||
assert v.focus.index == 2
|
||||
|
||||
|
||||
def test_remove():
|
||||
v = view.View()
|
||||
with taddons.context():
|
||||
f = [tflow.tflow(), tflow.tflow() ]
|
||||
v.add(f)
|
||||
assert len(v) == 2
|
||||
v.remove(f)
|
||||
assert len(v) == 0
|
||||
|
||||
|
||||
def test_setgetval():
|
||||
v = view.View()
|
||||
with taddons.context():
|
||||
|
Loading…
Reference in New Issue
Block a user