about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-13 23:35:25 +0100
committerhut <hut@lavabit.com>2010-01-13 23:35:25 +0100
commit0bc410c523f397f9c46c04ded5b3da1da65a6242 (patch)
tree1bc418f59ad2d3cd5fccdc1e6dee8ae667a931e7 /test
parent1f9a86d1515416a03721be261ae8fc937f129e9d (diff)
downloadranger-0bc410c523f397f9c46c04ded5b3da1da65a6242.tar.gz
commandlist: aliases are now references rather than copies
Diffstat (limited to 'test')
-rw-r--r--test/tc_commandlist.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/tc_commandlist.py b/test/tc_commandlist.py
index 5062be9f..f1edfa20 100644
--- a/test/tc_commandlist.py
+++ b/test/tc_commandlist.py
@@ -10,6 +10,7 @@ class Test(TestCase):
 	def test_commandist(self):
 		cl = CL()
 		fnc = lambda arg: 1
+		fnc2 = lambda arg: 2
 		dmy = cl.dummy_object
 
 		cl.bind(fnc, 'aaaa')
@@ -51,14 +52,24 @@ class Test(TestCase):
 		self.assertEqual(dmy, cl['aaa'])
 		self.assertEqual(fnc, cl['aaaa'].execute)
 
+		# ------------------------ test aliases
 		cl.alias('aaaa', 'c')
 		cl.rebuild_paths()
-		self.assertEqual(cl['c'], cl['aaaa'])
+
+		self.assertEqual(cl['c'].execute, cl['aaaa'].execute)
+
+		cl.bind(fnc2, 'aaaa')
+		cl.rebuild_paths()
+
+		self.assertEqual(cl['c'].execute, cl['aaaa'].execute)
+
 		cl.unbind('c')
 		cl.rebuild_paths()
-		self.assertEqual(fnc, cl['aaaa'].execute)
+
+		self.assertEqual(fnc2, cl['aaaa'].execute)
 		self.assertKeyError(cl, 'c')
 
+		# ----------------------- test clearing
 		cl.clear()
 		self.assertKeyError(cl, 'a')
 		self.assertKeyError(cl, 'aa')