summary refs log tree commit diff stats
path: root/test/tc_keyapi.py
blob: d6c32271108b817de9759fbddc6ba0e1a7566555 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if __name__ == '__main__': from __init__ import init; init()

from unittest import TestCase, main

class Test(TestCase):
	def test_wrapper(self):
		from ranger.keyapi import Wrapper

		class dummyfm(object):
			def move(relative):
				return "I move down by {0}".format(relative)

		class commandarg(object):
			def __init__(self):
				self.fm = dummyfm
				self.n = None

		arg = commandarg()

		do = Wrapper('fm')
		command = do.move(relative=4)

		self.assertEqual(command(arg), 'I move down by 4')

if __name__ == '__main__': main()
big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/work/ranger/ranger/gui/__init__.py">/home/hut/work/ranger/ranger/gui/__init__.py</a></font></td></tr></table> <p></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> <td colspan=3 valign=bottom>&nbsp;<br> <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ranger.gui.color.html">color</a><br> <a href="ranger.gui.colorscheme.html">colorscheme</a><br> </td><td width="25%" valign=top><a href="ranger.gui.defaultui.html">defaultui</a><br> <a href="ranger.gui.displayable.html">displayable</a><br> </td><td width="25%" valign=top><a href="ranger.gui.mouse_event.html">mouse_event</a><br> <a href="ranger.gui.ui.html">ui</a><br> </td><td width="25%" valign=top><a href="ranger.gui.widgets.html"><strong>widgets</strong>&nbsp;(package)</a><br> </td></tr></table></td></tr></table> </body></html>