addons.view: fix tests

This commit is contained in:
Aldo Cortesi 2016-10-30 17:01:15 +13:00
parent 0b2a2ad2a6
commit 7a6bae336b

View File

@ -211,14 +211,13 @@ class Focus:
def __init__(self, v: View) -> None:
self.view = v
self._flow = None
self.sig_change = blinker.Signal()
if len(self.view):
self.flow = self.view[0]
v.sig_add.connect(self._sig_add)
v.sig_remove.connect(self._sig_remove)
v.sig_refresh.connect(self._sig_refresh)
self.sig_change = blinker.Signal()
@property
def flow(self) -> typing.Optional[mitmproxy.flow.Flow]:
return self._flow