taddons: remove has_event

We no longer use this anywhere, so ditch it.
This commit is contained in:
Aldo Cortesi 2018-05-02 11:31:28 +12:00
parent 22a4b1d5d4
commit 38ff8109fb
2 changed files with 0 additions and 12 deletions

View File

@ -17,10 +17,6 @@ class TestAddons(addonmanager.AddonManager):
def trigger(self, event, *args, **kwargs):
if event == "log":
self.master.logs.append(args[0])
elif event == "tick" and not args and not kwargs:
pass
else:
self.master.events.append((event, args, kwargs))
super().trigger(event, *args, **kwargs)
@ -28,7 +24,6 @@ class RecordingMaster(mitmproxy.master.Master):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.addons = TestAddons(self)
self.events = []
self.logs = []
def dump_log(self, outf=sys.stdout):
@ -51,12 +46,6 @@ class RecordingMaster(mitmproxy.master.Master):
await asyncio.sleep(0.1)
return False
def has_event(self, name):
for i in self.events:
if i[0] == name:
return True
return False
def clear(self):
self.logs = []

View File

@ -10,7 +10,6 @@ from mitmproxy import ctx
async def test_recordingmaster():
with taddons.context() as tctx:
assert not tctx.master.has_log("nonexistent")
assert not tctx.master.has_event("nonexistent")
ctx.log.error("foo")
assert not tctx.master.has_log("foo", level="debug")
assert await tctx.master.await_log("foo", level="error")