diff options
Diffstat (limited to 'test/mitmproxy/tools/console/test_defaultkeys.py')
-rw-r--r-- | test/mitmproxy/tools/console/test_defaultkeys.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/mitmproxy/tools/console/test_defaultkeys.py b/test/mitmproxy/tools/console/test_defaultkeys.py index 035f71f7..7e8df6b6 100644 --- a/test/mitmproxy/tools/console/test_defaultkeys.py +++ b/test/mitmproxy/tools/console/test_defaultkeys.py @@ -3,12 +3,14 @@ from mitmproxy.tools.console import defaultkeys from mitmproxy.tools.console import keymap from mitmproxy.tools.console import master from mitmproxy import command - +from mitmproxy import ctx import pytest @pytest.mark.asyncio async def test_commands_exist(): + command_manager = command.CommandManager(ctx) + km = keymap.Keymap(None) defaultkeys.map(km) assert km.bindings @@ -16,7 +18,10 @@ async def test_commands_exist(): await m.load_flow(tflow()) for binding in km.bindings: - cmd, *args = command.get_lexer(binding.command) + results = command_manager.parse_partial(binding.command) + + cmd = results[0][0].value + args = [a.value for a in results[0][1:]] assert cmd in m.commands.commands @@ -24,4 +29,7 @@ async def test_commands_exist(): try: cmd_obj.prepare_args(args) except Exception as e: + + import pdb + pdb.set_trace() raise ValueError("Invalid command: {}".format(binding.command)) from e |