From 875adb2ba82bb6b94fec755d4f2ac9800066c47d Mon Sep 17 00:00:00 2001 From: Henrique Date: Wed, 13 Nov 2019 09:32:51 -0500 Subject: Added tests to reach 100% coverage --- test/mitmproxy/test_command.py | 6 +++++- test/mitmproxy/test_lexer.py | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'test') 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) - - -- cgit v1.2.3