aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2017-03-05 14:55:46 +1300
committerAldo Cortesi <aldo@nullcube.com>2017-03-05 15:10:03 +1300
commit67381ae550a5d57c1f2841cd7118550afdfaa736 (patch)
treecb96c6def6624aa8e42c88dca5597e58d457106a /mitmproxy/test
parente0644398b62a312652c15569c0f530a27963dcf4 (diff)
downloadmitmproxy-67381ae550a5d57c1f2841cd7118550afdfaa736.tar.gz
mitmproxy-67381ae550a5d57c1f2841cd7118550afdfaa736.tar.bz2
mitmproxy-67381ae550a5d57c1f2841cd7118550afdfaa736.zip
Revamp options
- Options are now explicitly initialized with an add_option method - We have one canonical Options class - ditch dump.Options
Diffstat (limited to 'mitmproxy/test')
-rw-r--r--mitmproxy/test/taddons.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/mitmproxy/test/taddons.py b/mitmproxy/test/taddons.py
index bb8daa02..c3e19cc7 100644
--- a/mitmproxy/test/taddons.py
+++ b/mitmproxy/test/taddons.py
@@ -4,7 +4,6 @@ import mitmproxy.master
import mitmproxy.options
from mitmproxy import proxy
from mitmproxy import eventsequence
-from mitmproxy import exceptions
class RecordingMaster(mitmproxy.master.Master):
@@ -43,14 +42,6 @@ class context:
return False
@contextlib.contextmanager
- def _rollback(self, opts, updates):
- old = opts._opts.copy()
- try:
- yield
- except exceptions.OptionsError as e:
- opts.__dict__["_opts"] = old
- raise
-
def cycle(self, addon, f):
"""
Cycles the flow through the events for the flow. Stops if a reply
@@ -70,6 +61,5 @@ class context:
Options object with the given keyword arguments, then calls the
configure method on the addon with the updated value.
"""
- with self._rollback(self.options, kwargs):
- self.options.update(**kwargs)
- addon.configure(self.options, kwargs.keys())
+ self.options.update(**kwargs)
+ addon.configure(self.options, kwargs.keys())