aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMiroslav <ttahabatt@gmail.com>2018-09-29 15:54:17 +0300
committerMiroslav <ttahabatt@gmail.com>2018-09-29 15:54:17 +0300
commited9e3d5137974dc824c8350d89439c46f711ef46 (patch)
tree705587dd8e41e32d20dbd9f82b05fb2bfefabd2e /test
parent7f5d8d0997dde853c90831eef4678b06104f7e76 (diff)
downloadmitmproxy-ed9e3d5137974dc824c8350d89439c46f711ef46.tar.gz
mitmproxy-ed9e3d5137974dc824c8350d89439c46f711ef46.tar.bz2
mitmproxy-ed9e3d5137974dc824c8350d89439c46f711ef46.zip
keys.yaml priority over defaultkeys.py. Test for this.
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/tools/console/test_keymap.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/mitmproxy/tools/console/test_keymap.py b/test/mitmproxy/tools/console/test_keymap.py
index 3e6f7c2e..0d6f9e88 100644
--- a/test/mitmproxy/tools/console/test_keymap.py
+++ b/test/mitmproxy/tools/console/test_keymap.py
@@ -117,6 +117,21 @@ def test_load_path(tmpdir):
kmc.load_path(km, dst)
assert(km.get("chooser", "key1"))
+ km.add("key123", "str", ["flowlist", "flowview"])
+ with open(dst, 'w') as f:
+ f.write(
+ """
+ - key: key123
+ ctx: [options]
+ cmd: foo
+ """
+ )
+ kmc.load_path(km, dst)
+ for b in km.bindings:
+ if b.key == "key123":
+ assert b.contexts == ["options"]
+ break
+
def test_parse():
kmc = keymap.KeymapConfig()