MCPcopy
hub / github.com/mitmproxy/mitmproxy / configure

Method configure

mitmproxy/test/taddons.py:56–68  ·  view source on GitHub ↗

A helper for testing configure methods. Modifies the registered Options object with the given keyword arguments, then calls the configure method on the addon with the updated value.

(self, addon, **kwargs)

Source from the content-addressed store, hash-verified

54 return
55
56 def configure(self, addon, **kwargs):
57 """
58 A helper for testing configure methods. Modifies the registered
59 Options object with the given keyword arguments, then calls the
60 configure method on the addon with the updated value.
61 """
62 if addon not in self.master.addons:
63 self.master.addons.register(addon)
64 with self.options.rollback(kwargs.keys(), reraise=True):
65 if kwargs:
66 self.options.update(**kwargs)
67 else:
68 self.master.addons.invoke_addon_sync(addon, hooks.ConfigureHook(set()))
69
70 def script(self, path):
71 """

Callers

nothing calls this directly

Calls 6

setFunction · 0.85
rollbackMethod · 0.80
invoke_addon_syncMethod · 0.80
registerMethod · 0.45
keysMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected