From 491f9bdceef039ec641e6e77d0d1e7e5fef1e50b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 3 Jun 2012 01:11:07 -0700 Subject: Add unit tests for console/help.py --- test/test_console_help.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/test_console_help.py (limited to 'test') diff --git a/test/test_console_help.py b/test/test_console_help.py new file mode 100644 index 00000000..e747635f --- /dev/null +++ b/test/test_console_help.py @@ -0,0 +1,25 @@ +import sys +import libpry +import libmproxy.console.help as help +from libmproxy import utils, flow, encoding + +class DummyMaster: + def make_view(self): + pass + + +class uHelp(libpry.AutoTree): + 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" + + +tests = [ + uHelp() +] -- cgit v1.2.3