summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2004-09-13 15:24:43 (GMT)
committerBarry Warsaw <barry@python.org>2004-09-13 15:24:43 (GMT)
commitc7cd20c8c6862558e54c17755f493889725c0ce8 (patch)
tree40ccb7457f1469d0fa63bd7dd1f3add0cc9fea58 /Lib
parent7642f7af0d7165e1c170d83242fd0c6e35f54942 (diff)
downloadcpython-c7cd20c8c6862558e54c17755f493889725c0ce8.zip
cpython-c7cd20c8c6862558e54c17755f493889725c0ce8.tar.gz
cpython-c7cd20c8c6862558e54c17755f493889725c0ce8.tar.bz2
Added a test for # positional arguments > 1.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_pep292.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_pep292.py b/Lib/test/test_pep292.py
index 6c6aa9f..377db7f 100644
--- a/Lib/test/test_pep292.py
+++ b/Lib/test/test_pep292.py
@@ -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():