[Python-checkins] python/dist/src/Lib/test test_pep292.py,1.3,1.4

bwarsaw at users.sourceforge.net bwarsaw at users.sourceforge.net
Mon Sep 13 17:24:46 CEST 2004


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

Modified Files:
	test_pep292.py 
Log Message:
Added a test for # positional arguments > 1.


Index: test_pep292.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pep292.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- test_pep292.py	13 Sep 2004 14:35:59 -0000	1.3
+++ test_pep292.py	13 Sep 2004 15:24:43 -0000	1.4
@@ -134,6 +134,7 @@
 
     def test_keyword_arguments_safe(self):
         eq = self.assertEqual
+        raises = self.assertRaises
         s = Template('$who likes $what')
         eq(s.safe_substitute(who='tim', what='ham'), 'tim likes ham')
         eq(s.safe_substitute(dict(who='tim'), what='ham'), 'tim likes ham')
@@ -145,6 +146,9 @@
            'the mapping is bozo')
         eq(s.safe_substitute(dict(mapping='one'), mapping='two'),
            'the mapping is two')
+        d = dict(mapping='one')
+        raises(TypeError, s.substitute, d, {})
+        raises(TypeError, s.safe_substitute, d, {})
 
 
 def suite():



More information about the Python-checkins mailing list