Lines Matching full:substitute
26 self.assertEqual(s.substitute(dict(who='tim', what='ham')),
28 self.assertRaises(KeyError, s.substitute, dict(who='tim'))
33 self.assertEqual(s.substitute(d), 'tim likes ham for dinner')
34 self.assertRaises(KeyError, s.substitute,
40 eq(s.substitute(dict(who='tim', what='ham')),
43 eq(s.substitute(dict(who='tim', what='ham')), 'tim likes $')
49 eq(s.substitute(d), '%(foo)s baz baz')
56 eq(s.substitute(d), 'tim has eaten 7 bags of ham today')
59 eq(s.substitute(d), 'tim has eaten 7 bags of ham today')
65 eq(s.substitute(d), "('tim', 'fred') ate ('ham', 'kung pao')")
83 raises(ValueError, s.substitute, dict(who='tim'))
85 raises(ValueError, s.substitute, dict(who='tim'))
87 raises(ValueError, s.substitute, dict(who='tim'))
98 self.assertEqual(s.substitute(m), 'tim likes to eat a bag of ham')
114 self.assertEqual(s.substitute(m), 'tim likes to eat a bag of ham')
125 self.assertRaises(ValueError, s.substitute, {})
131 self.assertEqual(s.substitute(d), u't\xffm likes f\xfe\x0ced')
136 eq(s.substitute(who='tim', what='ham'), 'tim likes ham')
137 eq(s.substitute(dict(who='tim'), what='ham'), 'tim likes ham')
138 eq(s.substitute(dict(who='fred', what='kung pao'),
142 eq(s.substitute(dict(foo='none'), mapping='bozo'),
144 eq(s.substitute(dict(mapping='one'), mapping='two'),
162 raises(TypeError, s.substitute, d, {})
171 eq(s.substitute(gift='bud', who='you'), 'this bud is for you &')
172 raises(KeyError, s.substitute)
176 raises(ValueError, s.substitute, dict(gift='bud', who='you'))
182 self.assertEqual(s.substitute(dict(who='tim', what='ham')),