From a666f32b959416d062ac38645dc27f20686d881b Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 27 Dec 2009 23:41:04 +0100 Subject: test case for keyapi.Wrapper --- test/tc_keyapi.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/tc_keyapi.py (limited to 'test') diff --git a/test/tc_keyapi.py b/test/tc_keyapi.py new file mode 100644 index 00000000..f1067e26 --- /dev/null +++ b/test/tc_keyapi.py @@ -0,0 +1,24 @@ +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 + + arg = commandarg() + + do = Wrapper('fm') + command = do.move(relative=4) + + self.assertEqual(command(arg), 'I move down by 4') + +if __name__ == '__main__': main() -- cgit 1.4.1-2-gfad0