aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-03 01:11:07 -0700
committerAldo Cortesi <aldo@nullcube.com>2012-06-03 01:11:07 -0700
commit491f9bdceef039ec641e6e77d0d1e7e5fef1e50b (patch)
treeda35910615e9ce53f0118b8f9b6b9352b8f61f66 /test
parentb36e37f9dad880f3071c6e65bce13e78988f3dba (diff)
downloadmitmproxy-491f9bdceef039ec641e6e77d0d1e7e5fef1e50b.tar.gz
mitmproxy-491f9bdceef039ec641e6e77d0d1e7e5fef1e50b.tar.bz2
mitmproxy-491f9bdceef039ec641e6e77d0d1e7e5fef1e50b.zip
Add unit tests for console/help.py
Diffstat (limited to 'test')
-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()
+]