aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_command.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/mitmproxy/test_command.py b/test/mitmproxy/test_command.py
index c8007463..5218042c 100644
--- a/test/mitmproxy/test_command.py
+++ b/test/mitmproxy/test_command.py
@@ -64,6 +64,16 @@ class TestCommand:
c = command.Command(cm, "cmd.three", a.cmd3)
assert c.call(["1"]) == 1
+ def test_parse_partial(self):
+ tests = [
+ ["foo bar", [("foo", command.Cmd), ("bar", str)]],
+ ["foo 'bar", [("foo", command.Cmd), ("'bar", str)]],
+ ]
+ with taddons.context() as tctx:
+ cm = command.CommandManager(tctx.master)
+ for s, expected in tests:
+ assert cm.parse_partial(s) == expected
+
def test_simple():
with taddons.context() as tctx: