aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHenrique <typoon@gmail.com>2019-11-13 09:32:51 -0500
committerHenrique <typoon@gmail.com>2019-11-13 09:32:51 -0500
commit875adb2ba82bb6b94fec755d4f2ac9800066c47d (patch)
tree1fe5ace1107f17d018e1a3d78e94ac0ecf204b9b /test
parentcf6839a9d9e09e2bcb7fcc1acd3ecafa82415748 (diff)
downloadmitmproxy-875adb2ba82bb6b94fec755d4f2ac9800066c47d.tar.gz
mitmproxy-875adb2ba82bb6b94fec755d4f2ac9800066c47d.tar.bz2
mitmproxy-875adb2ba82bb6b94fec755d4f2ac9800066c47d.zip
Added tests to reach 100% coverage
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_command.py6
-rw-r--r--test/mitmproxy/test_lexer.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/test/mitmproxy/test_command.py b/test/mitmproxy/test_command.py
index 2785e28f..ad475fba 100644
--- a/test/mitmproxy/test_command.py
+++ b/test/mitmproxy/test_command.py
@@ -139,7 +139,7 @@ class TestCommand:
],
[
"",
- [command.ParseResult(value = "", type = mitmproxy.types.Cmd, valid = False)],
+ [],
[]
],
[
@@ -283,6 +283,10 @@ def test_simple():
c.call("nonexistent")
with pytest.raises(exceptions.CommandError, match="Unknown"):
c.execute("\\")
+ with pytest.raises(exceptions.CommandError, match="Unknown"):
+ c.execute(r"\'")
+ with pytest.raises(exceptions.CommandError, match="Unknown"):
+ c.execute(r"\"")
c.add("empty", a.empty)
c.execute("empty")
diff --git a/test/mitmproxy/test_lexer.py b/test/mitmproxy/test_lexer.py
index a1898620..19ef155b 100644
--- a/test/mitmproxy/test_lexer.py
+++ b/test/mitmproxy/test_lexer.py
@@ -73,5 +73,3 @@ class TestScripts:
tokens = list(lex)
result = ['Increase', 'test', 'coverage']
assert(tokens == result)
-
-