aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHenrique <typoon@gmail.com>2019-11-13 10:32:17 -0500
committerHenrique <typoon@gmail.com>2019-11-13 10:32:17 -0500
commitf2b118817efa16c0d019b98cf2d6519b67fe7323 (patch)
tree6a767847427b5d616029d960e8b2abba469095af /test
parentaf7088d7f377ff32e2ff9ab197f6c899a835515d (diff)
downloadmitmproxy-f2b118817efa16c0d019b98cf2d6519b67fe7323.tar.gz
mitmproxy-f2b118817efa16c0d019b98cf2d6519b67fe7323.tar.bz2
mitmproxy-f2b118817efa16c0d019b98cf2d6519b67fe7323.zip
Added a new test to test that the issue from the previous commit won't
happen anymore
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/tools/console/test_commander.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/mitmproxy/tools/console/test_commander.py b/test/mitmproxy/tools/console/test_commander.py
index b5e226fe..81e007f0 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: