]> granicus.if.org Git - python/commitdiff
Added a test for # positional arguments > 1.
authorBarry Warsaw <barry@python.org>
Mon, 13 Sep 2004 15:24:43 +0000 (15:24 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 13 Sep 2004 15:24:43 +0000 (15:24 +0000)
Lib/test/test_pep292.py

index 6c6aa9fb45b5ea4fb6c6e666e89a3b53f7ee2d52..377db7fecf59f7e78da05485ce9a63130a5af099 100644 (file)
@@ -134,6 +134,7 @@ class TestTemplate(unittest.TestCase):
 
     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 @@ class TestTemplate(unittest.TestCase):
            '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():