Lines Matching refs:safe_substitute
267 eq(s.safe_substitute(d), '%(foo)s baz baz')
274 eq(s.safe_substitute(d), 'tim has eaten 7 bags of ham today')
283 eq(s.safe_substitute(d), "('tim', 'fred') ate ('ham', 'kung pao')")
288 eq(s.safe_substitute(dict(who='tim')), 'tim likes ${what} for ${meal}')
289 eq(s.safe_substitute(dict(what='ham')), '$who likes ham for ${meal}')
290 eq(s.safe_substitute(dict(what='ham', meal='dinner')),
292 eq(s.safe_substitute(dict(who='tim', what='ham')),
294 eq(s.safe_substitute(dict(who='tim', what='ham', meal='dinner')),
343 self.assertRaises(ValueError, s.safe_substitute, {})
375 self.assertEqual(t.safe_substitute(), tmpl)
376 val = t.safe_substitute({'location': 'Cleveland'})
405 eq(s.safe_substitute(who='tim', what='ham'), 'tim likes ham')
406 eq(s.safe_substitute(dict(who='tim'), what='ham'), 'tim likes ham')
407 eq(s.safe_substitute(dict(who='fred', what='kung pao'),
411 eq(s.safe_substitute(dict(foo='none'), mapping='bozo'),
413 eq(s.safe_substitute(dict(mapping='one'), mapping='two'),
417 raises(TypeError, s.safe_substitute, d, {})
420 eq(s.safe_substitute(self='bozo'), 'the self is bozo')
430 eq(s.safe_substitute(gift='bud', who='you'), 'this bud is for you &')
431 eq(s.safe_substitute(), 'this &gift is for &{who} &')
434 eq(s.safe_substitute(), 'this &gift is for &{who} &')