aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2017-04-26 11:45:15 +1200
committerAldo Cortesi <aldo@nullcube.com>2017-04-26 19:56:33 +1200
commit5327756377d239f059e84de4063cfcaa592fdb3d (patch)
tree9c8de935d8e627621c98d4daf39ac25e895905e0 /mitmproxy/test
parente32efcae49ba5857feae85b9b4651a45d9e5fcc3 (diff)
downloadmitmproxy-5327756377d239f059e84de4063cfcaa592fdb3d.tar.gz
mitmproxy-5327756377d239f059e84de4063cfcaa592fdb3d.tar.bz2
mitmproxy-5327756377d239f059e84de4063cfcaa592fdb3d.zip
Addons and addon testing
- Fix some loading sequence bugs affecting command-line script invocation - Allow addons to over-ride existing options (with a warning). We need this for reloading. - Convert har_dump to new-style arguments, fix and re-instate its test suite. - Covnert miscelaneous other exmples to new-style args.
Diffstat (limited to 'mitmproxy/test')
-rw-r--r--mitmproxy/test/taddons.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mitmproxy/test/taddons.py b/mitmproxy/test/taddons.py
index 39ebb2e6..ea9534af 100644
--- a/mitmproxy/test/taddons.py
+++ b/mitmproxy/test/taddons.py
@@ -120,3 +120,9 @@ class context:
self.configure(sc)
self.master.addons.invoke_addon(sc, "tick")
return sc.addons[0] if sc.addons else None
+
+ def invoke(self, addon, event, *args, **kwargs):
+ """
+ Recursively invoke an event on an addon and all its children.
+ """
+ return self.master.addons.invoke_addon(addon, event, *args, **kwargs)