MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_nesting

Function test_nesting

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

Source from the content-addressed store, hash-verified

224
225
226async def test_nesting():
227 o = options.Options()
228 m = master.Master(o)
229 a = addonmanager.AddonManager(m)
230
231 a.add(
232 TAddon("one", addons=[TAddon("two"), TAddon("three", addons=[TAddon("four")])])
233 )
234 assert len(a.chain) == 1
235 assert a.get("one")
236 assert a.get("two")
237 assert a.get("three")
238 assert a.get("four")
239
240 a.trigger(hooks.RunningHook())
241 assert a.get("one").running_called
242 assert a.get("two").running_called
243 assert a.get("three").running_called
244 assert a.get("four").running_called
245
246 a.remove(a.get("three"))
247 assert not a.get("three")
248 assert not a.get("four")
249
250
251async def test_old_api(caplog):

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
getMethod · 0.95
triggerMethod · 0.95
removeMethod · 0.95
TAddonClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…