aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2017-06-11 17:45:59 +1200
committerGitHub <noreply@github.com>2017-06-11 17:45:59 +1200
commit40703afd0abf28134abbc1d2f8d49b8a555f0d47 (patch)
treee0f02ac8d2701b7809de89de2f78cb413c480280 /test
parent75c047da3f8a3f22d66384c980fde802ee4101f7 (diff)
parent7caa7e7538581e21bab3f003e01b5388060683c3 (diff)
downloadmitmproxy-40703afd0abf28134abbc1d2f8d49b8a555f0d47.tar.gz
mitmproxy-40703afd0abf28134abbc1d2f8d49b8a555f0d47.tar.bz2
mitmproxy-40703afd0abf28134abbc1d2f8d49b8a555f0d47.zip
Merge pull request #2386 from cortesi/help
console help
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/tools/console/test_help.py11
-rw-r--r--test/mitmproxy/tools/console/test_keymap.py37
2 files changed, 20 insertions, 28 deletions
diff --git a/test/mitmproxy/tools/console/test_help.py b/test/mitmproxy/tools/console/test_help.py
deleted file mode 100644
index 0ebc2d6a..00000000
--- a/test/mitmproxy/tools/console/test_help.py
+++ /dev/null
@@ -1,11 +0,0 @@
-import mitmproxy.tools.console.help as help
-
-from ....conftest import skip_appveyor
-
-
-@skip_appveyor
-class TestHelp:
-
- def test_helptext(self):
- h = help.HelpView(None)
- assert h.helptext()
diff --git a/test/mitmproxy/tools/console/test_keymap.py b/test/mitmproxy/tools/console/test_keymap.py
index 6a75800e..bbca4ac9 100644
--- a/test/mitmproxy/tools/console/test_keymap.py
+++ b/test/mitmproxy/tools/console/test_keymap.py
@@ -5,25 +5,28 @@ import pytest
def test_bind():
- with taddons.context() as tctx:
- km = keymap.Keymap(tctx.master)
- km.executor = mock.Mock()
+ with taddons.context() as tctx:
+ km = keymap.Keymap(tctx.master)
+ km.executor = mock.Mock()
- with pytest.raises(ValueError):
- km.add("foo", "bar", ["unsupported"])
+ with pytest.raises(ValueError):
+ km.add("foo", "bar", ["unsupported"])
- km.add("key", "str", ["options", "commands"])
- assert km.get("options", "key")
- assert km.get("commands", "key")
- assert not km.get("flowlist", "key")
+ km.add("key", "str", ["options", "commands"])
+ assert km.get("options", "key")
+ assert km.get("commands", "key")
+ assert not km.get("flowlist", "key")
+ assert len((km.list("commands"))) == 1
- km.handle("unknown", "unknown")
- assert not km.executor.called
+ km.handle("unknown", "unknown")
+ assert not km.executor.called
- km.handle("options", "key")
- assert km.executor.called
+ km.handle("options", "key")
+ assert km.executor.called
- km.add("glob", "str", ["global"])
- km.executor = mock.Mock()
- km.handle("options", "glob")
- assert km.executor.called
+ km.add("glob", "str", ["global"])
+ km.executor = mock.Mock()
+ km.handle("options", "glob")
+ assert km.executor.called
+
+ assert len((km.list("global"))) == 1