summary refs log tree commit diff stats
path: root/test/tc_newkeys.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-14 17:27:04 +0200
committerhut <hut@lavabit.com>2010-05-14 17:27:04 +0200
commit420d3d1af8d2991ae6a8cbe061adaab878c4b3ff (patch)
treead1cdc33cc12984c141618439b646424d8a76c25 /test/tc_newkeys.py
parent792d6b23711c428a4a2b98537f44e2fbaed97fdd (diff)
parent2f3326a41430364cb34a227d311691cada605327 (diff)
downloadranger-420d3d1af8d2991ae6a8cbe061adaab878c4b3ff.tar.gz
Merge branch 'master' into cp
Conflicts:
	ranger/__main__.py
Diffstat (limited to 'test/tc_newkeys.py')
-rw-r--r--test/tc_newkeys.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/tc_newkeys.py b/test/tc_newkeys.py
index 8efb707d..c7a33025 100644
--- a/test/tc_newkeys.py
+++ b/test/tc_newkeys.py
@@ -17,6 +17,7 @@
 if __name__ == '__main__': from __init__ import init; init()
 from unittest import TestCase, main
 
+from test import TODO
 from ranger.ext.tree import Tree
 from ranger.container.keymap import *
 from ranger.container.keybuffer import KeyBuffer
@@ -423,7 +424,7 @@ class Test(PressTestCase):
 		self.assertPressFails(kb, 'xzy')
 		self.assertPressIncomplete(kb, 'xx')
 		self.assertPressIncomplete(kb, 'x')
-		if not sys.flags.optimize:
+		if not sys.flags.optimize:  # asserts are ignored with python -O
 			self.assertRaises(AssertionError, simulate_press, kb, 'xxx')
 		kb.clear()
 
@@ -587,8 +588,18 @@ class Test(PressTestCase):
 		self.assertEqual(5, press('gh'))
 		self.assertEqual(5, press('agh'))
 #		self.assertPressFails(kb, 'agh')
-		# TODO: Make the next line work!  For now, skip it.
-		# self.assertEqual(1, press('agg'))
+
+	@TODO
+	def test_map_collision2(self):
+		directions = KeyMap()
+		directions.map('gg', dir=Direction(down=1))
+		km = KeyMap()
+		km.map('agh', lambda _: 1)
+		km.map('a<dir>', lambda _: 2)
+		kb = KeyBuffer(km, directions)
+		press = self._mkpress(kb, km)
+		self.assertEqual(1, press('agh'))
+		self.assertEqual(2, press('agg'))
 
 	def test_keymap_with_dir(self):
 		def func(arg):