mitmproxy/test/test_console_help.py

20 lines
492 B
Python
Raw Normal View History

2012-06-03 08:11:07 +00:00
import sys
import libmproxy.console.help as help
from libmproxy import utils, flow, encoding
class DummyMaster:
def make_view(self):
pass
class TestHelp:
2012-06-03 08:11:07 +00:00
def test_helptext(self):
h = help.HelpView(None, "foo", None)
assert h.helptext()
def test_keypress(self):
h = help.HelpView(DummyMaster(), "foo", [1, 2, 3])
assert not h.keypress((0, 0), "q")
assert not h.keypress((0, 0), "?")
assert h.keypress((0, 0), "o") == "o"