aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHenrique <typoon@gmail.com>2019-11-12 18:57:39 -0500
committerHenrique <typoon@gmail.com>2019-11-12 18:57:39 -0500
commitc7ffc228194574d1cff2c2fbb05fc3419c4805f4 (patch)
treec1d37cd60f7e39eb9a9ef6253b04a9d2d11622a4 /test
parentd9572ef4a7eaf64726e236e7e0e9ac65a7b77719 (diff)
downloadmitmproxy-c7ffc228194574d1cff2c2fbb05fc3419c4805f4.tar.gz
mitmproxy-c7ffc228194574d1cff2c2fbb05fc3419c4805f4.tar.bz2
mitmproxy-c7ffc228194574d1cff2c2fbb05fc3419c4805f4.zip
Fix for issues when using \ and " on the commander bar
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_command.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/mitmproxy/test_command.py b/test/mitmproxy/test_command.py
index d9dcf5f9..2785e28f 100644
--- a/test/mitmproxy/test_command.py
+++ b/test/mitmproxy/test_command.py
@@ -249,10 +249,10 @@ class TestCommand:
["str"]
],
[
- "flow \"one two\"",
+ "flow \"three four\"",
[
command.ParseResult(value = "flow", type = mitmproxy.types.Cmd, valid = True),
- command.ParseResult(value = "one two", type = flow.Flow, valid = False),
+ command.ParseResult(value = '"three four"', type = flow.Flow, valid = False),
],
["str"]
],
@@ -270,7 +270,7 @@ def test_simple():
c = command.CommandManager(tctx.master)
a = TAddon()
c.add("one.two", a.cmd1)
- assert c.commands["one.two"].help == "cmd1 help"
+ assert(c.commands["one.two"].help == "cmd1 help")
assert(c.execute("one.two foo") == "ret foo")
assert(c.call("one.two", "foo") == "ret foo")
with pytest.raises(exceptions.CommandError, match="Unknown"):
@@ -281,7 +281,7 @@ def test_simple():
c.execute("one.two too many args")
with pytest.raises(exceptions.CommandError, match="Unknown"):
c.call("nonexistent")
- with pytest.raises(exceptions.CommandError, match="No escaped"):
+ with pytest.raises(exceptions.CommandError, match="Unknown"):
c.execute("\\")
c.add("empty", a.empty)