aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-07-29 20:38:27 +0200
committerMaximilian Hils <git@maximilianhils.com>2017-07-29 21:51:26 +0200
commitc29c5dbee850b019758d4281bf144fe2da8f8495 (patch)
tree2d4d06dccf1389e13792a4e1fde714adf27ecace
parent9ffd42edeacb19c3961840289bb25eaeca5991a5 (diff)
downloadmitmproxy-c29c5dbee850b019758d4281bf144fe2da8f8495.tar.gz
mitmproxy-c29c5dbee850b019758d4281bf144fe2da8f8495.tar.bz2
mitmproxy-c29c5dbee850b019758d4281bf144fe2da8f8495.zip
add OptManager.items
-rw-r--r--mitmproxy/optmanager.py3
-rw-r--r--test/mitmproxy/test_optmanager.py4
2 files changed, 7 insertions, 0 deletions
diff --git a/mitmproxy/optmanager.py b/mitmproxy/optmanager.py
index c28ec685..84c8d2ea 100644
--- a/mitmproxy/optmanager.py
+++ b/mitmproxy/optmanager.py
@@ -170,6 +170,9 @@ class OptManager:
def keys(self):
return set(self._options.keys())
+ def items(self):
+ return self._options.items()
+
def __contains__(self, k):
return k in self._options
diff --git a/test/mitmproxy/test_optmanager.py b/test/mitmproxy/test_optmanager.py
index 7b4ffb8b..fe72e6bb 100644
--- a/test/mitmproxy/test_optmanager.py
+++ b/test/mitmproxy/test_optmanager.py
@@ -229,6 +229,10 @@ def test_simple():
assert "one" in TO()
+def test_items():
+ assert TO().items()
+
+
def test_serialize():
o = TD2()
o.three = "set"