aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2017-04-28 10:21:15 +1200
committerAldo Cortesi <aldo@corte.si>2017-04-28 10:21:15 +1200
commitbe1b76b975ea6f9510a44cc3314414043c9364c6 (patch)
treea752241775002f161a345a4fab36d6a0b2b5fb37 /test
parent18edc1114592aa12fd7ce614b9757680594ca646 (diff)
downloadmitmproxy-be1b76b975ea6f9510a44cc3314414043c9364c6.tar.gz
mitmproxy-be1b76b975ea6f9510a44cc3314414043c9364c6.tar.bz2
mitmproxy-be1b76b975ea6f9510a44cc3314414043c9364c6.zip
console: add a keymap
This sketches out a keymap system for consone, and adds the first few top-level commands and mappings.
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_command.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/mitmproxy/test_command.py b/test/mitmproxy/test_command.py
index b984bea6..0c272a2c 100644
--- a/test/mitmproxy/test_command.py
+++ b/test/mitmproxy/test_command.py
@@ -18,6 +18,9 @@ class TAddon:
def cmd2(self, foo: str) -> str:
return 99
+ def empty(self) -> None:
+ pass
+
class TestCommand:
def test_call(self):
@@ -50,6 +53,9 @@ def test_simple():
with pytest.raises(exceptions.CommandError, match="Usage"):
c.call("one.two too many args")
+ c.add("empty", a.empty)
+ c.call("empty")
+
def test_typename():
assert command.typename(str, True) == "str"