aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_console_help.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_console_help.py')
-rw-r--r--test/test_console_help.py25
1 files changed, 25 insertions, 0 deletions
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()
+]