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

Function test_lifecycle

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

Source from the content-addressed store, hash-verified

107
108
109async def test_lifecycle():
110 o = options.Options()
111 m = master.Master(o)
112 a = addonmanager.AddonManager(m)
113 a.add(TAddon("one"))
114
115 assert str(a)
116
117 with pytest.raises(exceptions.AddonManagerError):
118 a.add(TAddon("one"))
119 with pytest.raises(exceptions.AddonManagerError):
120 a.remove(TAddon("nonexistent"))
121
122 f = tflow.tflow()
123 await a.handle_lifecycle(HttpRequestHook(f))
124
125 a._configure_all(o.keys())
126
127
128def test_defaults():

Callers

nothing calls this directly

Calls 7

addMethod · 0.95
removeMethod · 0.95
handle_lifecycleMethod · 0.95
_configure_allMethod · 0.95
HttpRequestHookClass · 0.90
TAddonClass · 0.70
keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…