Lines Matching refs:safe_substitute
245 eq(s.safe_substitute(d), '%(foo)s baz baz')
252 eq(s.safe_substitute(d), 'tim has eaten 7 bags of ham today')
261 eq(s.safe_substitute(d), "('tim', 'fred') ate ('ham', 'kung pao')")
266 eq(s.safe_substitute(dict(who='tim')), 'tim likes ${what} for ${meal}')
267 eq(s.safe_substitute(dict(what='ham')), '$who likes ham for ${meal}')
268 eq(s.safe_substitute(dict(what='ham', meal='dinner')),
270 eq(s.safe_substitute(dict(who='tim', what='ham')),
272 eq(s.safe_substitute(dict(who='tim', what='ham', meal='dinner')),
307 self.assertEqual(s.safe_substitute(d), 'fredHO likes ${WHAT} for dinner')
359 self.assertRaises(ValueError, s.safe_substitute, {})
391 self.assertEqual(t.safe_substitute(), tmpl)
392 val = t.safe_substitute({'location': 'Cleveland'})
441 eq(s.safe_substitute(who='tim', what='ham'), 'tim likes ham')
442 eq(s.safe_substitute(dict(who='tim'), what='ham'), 'tim likes ham')
443 eq(s.safe_substitute(dict(who='fred', what='kung pao'),
447 eq(s.safe_substitute(dict(foo='none'), mapping='bozo'),
449 eq(s.safe_substitute(dict(mapping='one'), mapping='two'),
453 raises(TypeError, s.safe_substitute, d, {})
456 eq(s.safe_substitute(self='bozo'), 'the self is bozo')
466 eq(s.safe_substitute(gift='bud', who='you'), 'this bud is for you &')
467 eq(s.safe_substitute(), 'this &gift is for &{who} &')
470 eq(s.safe_substitute(), 'this &gift is for &{who} &')