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')
/a> 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235