MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_async_halt

Function test_async_halt

test/mitmproxy/test_addonmanager.py:91–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89
90
91async def test_async_halt():
92 o = options.Options()
93 m = master.Master(o)
94 a = addonmanager.AddonManager(m)
95 halt = AsyncTHalt()
96 end = AsyncTAddon("end")
97 a.add(halt)
98 a.add(end)
99
100 assert not end.running_called
101 await a.trigger_event(hooks.RunningHook())
102 assert not end.running_called
103
104 a.remove(halt)
105 await a.trigger_event(hooks.RunningHook())
106 assert end.running_called
107
108
109async def test_lifecycle():

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
trigger_eventMethod · 0.95
removeMethod · 0.95
AsyncTHaltClass · 0.85
AsyncTAddonClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…