diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2017-03-05 14:55:46 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2017-03-05 15:10:03 +1300 |
commit | 67381ae550a5d57c1f2841cd7118550afdfaa736 (patch) | |
tree | cb96c6def6624aa8e42c88dca5597e58d457106a /mitmproxy/test | |
parent | e0644398b62a312652c15569c0f530a27963dcf4 (diff) | |
download | mitmproxy-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.py | 14 |
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()) |