aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMiroslav <ttahabatt@gmail.com>2018-01-19 02:07:01 +0200
committerMiroslav <ttahabatt@gmail.com>2018-01-19 02:07:01 +0200
commit0cb38f6329d1735aee9fe034499a8c1497172f9f (patch)
tree0d707680fad0a1fda9c026e8052ef274e81a0c68 /test
parent6dd336fcec6dc32c4986b6c20189bf1b2132153c (diff)
downloadmitmproxy-0cb38f6329d1735aee9fe034499a8c1497172f9f.tar.gz
mitmproxy-0cb38f6329d1735aee9fe034499a8c1497172f9f.tar.bz2
mitmproxy-0cb38f6329d1735aee9fe034499a8c1497172f9f.zip
Fix #2777
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/tools/console/test_commander.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/mitmproxy/tools/console/test_commander.py b/test/mitmproxy/tools/console/test_commander.py
index 2a96995d..cc2f3f35 100644
--- a/test/mitmproxy/tools/console/test_commander.py
+++ b/test/mitmproxy/tools/console/test_commander.py
@@ -1,4 +1,4 @@
-
+from mitmproxy import options
from mitmproxy.tools.console.commander import commander
from mitmproxy.test import taddons
@@ -96,3 +96,11 @@ class TestCommandBuffer:
with taddons.context() as tctx:
cb = commander.CommandBuffer(tctx.master)
assert cb.flatten("foo bar") == "foo bar"
+
+ def test_get_option_value(self):
+ opts = options.Options(view_filter="value")
+ with taddons.context(options=opts) as tctx:
+ cb = commander.CommandBuffer(tctx.master)
+ assert cb.get_option_value("set unknown_option=") == ""
+ assert cb.get_option_value("set intercept=") == ""
+ assert cb.get_option_value("set view_filter=") == "value"