[Python-checkins] python/dist/src/Lib/test test_bisect.py, 1.13, 1.13.2.1

rhettinger@users.sourceforge.net rhettinger at users.sourceforge.net
Wed Oct 5 13:48:39 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5788/Lib/test

Modified Files:
      Tag: release24-maint
	test_bisect.py 
Log Message:
SF #1313496:  bisect C replacement doesn't accept named args



Index: test_bisect.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bisect.py,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- test_bisect.py	27 Sep 2004 23:11:35 -0000	1.13
+++ test_bisect.py	5 Oct 2005 11:48:36 -0000	1.13.2.1
@@ -130,6 +130,16 @@
     def test_backcompatibility(self):
         self.assertEqual(bisect, bisect_right)
 
+    def test_keyword_args(self):
+        data = [10, 20, 30, 40, 50]
+        self.assertEqual(bisect_left(a=data, x=25, lo=1, hi=3), 2)
+        self.assertEqual(bisect_right(a=data, x=25, lo=1, hi=3), 2)
+        self.assertEqual(bisect(a=data, x=25, lo=1, hi=3), 2)
+        insort_left(a=data, x=25, lo=1, hi=3)
+        insort_right(a=data, x=25, lo=1, hi=3)
+        insort(a=data, x=25, lo=1, hi=3)
+        self.assertEqual(data, [10, 20, 25, 25, 25, 30, 40, 50])
+
 #==============================================================================
 
 class TestInsort(unittest.TestCase):



More information about the Python-checkins mailing list