Added a new test to test that the issue from the previous commit won't

happen anymore
This commit is contained in:
Henrique 2019-11-13 10:32:17 -05:00
parent af7088d7f3
commit f2b118817e

View File

@ -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: