From f2b118817efa16c0d019b98cf2d6519b67fe7323 Mon Sep 17 00:00:00 2001 From: Henrique Date: Wed, 13 Nov 2019 10:32:17 -0500 Subject: [PATCH] Added a new test to test that the issue from the previous commit won't happen anymore --- test/mitmproxy/tools/console/test_commander.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/mitmproxy/tools/console/test_commander.py b/test/mitmproxy/tools/console/test_commander.py index b5e226fe7..81e007f09 100644 --- a/test/mitmproxy/tools/console/test_commander.py +++ b/test/mitmproxy/tools/console/test_commander.py @@ -1,6 +1,6 @@ - from mitmproxy.tools.console.commander import commander from mitmproxy.test import taddons +import pytest class TestListCompleter: @@ -28,6 +28,18 @@ class TestListCompleter: assert c.cycle() == expected +class TestCommandEdit: + def test_open_command_bar(self): + with taddons.context() as tctx: + history = commander.CommandHistory(tctx.master, size=3) + edit = commander.CommandEdit(tctx.master, '', history) + + try: + edit.update() + except IndexError: + pytest.faied("Unexpected IndexError") + + class TestCommandHistory: def fill_history(self, commands): with taddons.context() as tctx: