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: def __init__(self, v: View) -> None:
self.view = v self.view = v
self._flow = None self._flow = None
self.sig_change = blinker.Signal()
if len(self.view): if len(self.view):
self.flow = self.view[0] self.flow = self.view[0]
v.sig_add.connect(self._sig_add) v.sig_add.connect(self._sig_add)
v.sig_remove.connect(self._sig_remove) v.sig_remove.connect(self._sig_remove)
v.sig_refresh.connect(self._sig_refresh) v.sig_refresh.connect(self._sig_refresh)
self.sig_change = blinker.Signal()
@property @property
def flow(self) -> typing.Optional[mitmproxy.flow.Flow]: def flow(self) -> typing.Optional[mitmproxy.flow.Flow]:
return self._flow return self._flow