about summary refs log blame commit diff stats
path: root/test/tc_keyapi.py
blob: 9fc6560684ef880a95efbd47b4c1e45173368f5e (plain) (tree)
1
2
3
4
5
6
7
8
9





                                                            
                                                   

                                      
                                                 



                                                                            
                                                   
                                             








                                                                  
if __name__ == '__main__': from __init__ import init; init()

from unittest import TestCase, main

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

		class dummyfm(object):
			def move(self, 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()