Lines Matching refs:who

209         s = Template('$who likes to eat a bag of $what worth $$100')
210 self.assertEqual(s.substitute(dict(who='tim', what='ham')),
212 self.assertRaises(KeyError, s.substitute, dict(who='tim'))
216 s = Template('$who likes ${what} for ${meal}')
217 d = dict(who='tim', what='ham', meal='dinner')
220 dict(who='tim', what='ham'))
234 s = Template('$who likes to eat a bag of $$what worth $$100')
235 eq(s.substitute(dict(who='tim', what='ham')),
237 s = Template('$who likes $$')
238 eq(s.substitute(dict(who='tim', what='ham')), 'tim likes $')
258 s = Template('$who ate ${meal}')
259 d = dict(who=('tim', 'fred'), meal=('ham', 'kung pao'))
265 s = Template('$who likes ${what} for ${meal}')
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}')
269 '$who likes ham for dinner')
270 eq(s.safe_substitute(dict(who='tim', what='ham')),
272 eq(s.safe_substitute(dict(who='tim', what='ham', meal='dinner')),
277 s = Template('$who likes $')
278 raises(ValueError, s.substitute, dict(who='tim'))
279 s = Template('$who likes ${what)')
280 raises(ValueError, s.substitute, dict(who='tim'))
281 s = Template('$who likes $100')
282 raises(ValueError, s.substitute, dict(who='tim'))
285 s = Template("$who likes $\u0131") # (DOTLESS I)
286 raises(ValueError, s.substitute, dict(who='tim'))
287 s = Template("$who likes $\u0130") # (LATIN CAPITAL LETTER I WITH DOT ABOVE)
288 raises(ValueError, s.substitute, dict(who='tim'))
296 m.bag.foo.who = 'tim'
298 s = PathPattern('$bag.foo.who likes to eat a bag of $bag.what')
344 m.bag.foo.who = 'tim'
346 s = MyPattern('@bag.foo.who likes to eat a bag of @bag.what')
357 s = BadPattern('@bag.foo.who likes to eat a bag of @bag.what')
416 s = Template('$who likes $what')
417 d = dict(who='t\xffm', what='f\xfe\fed')
422 s = Template('$who likes $what')
423 eq(s.substitute(who='tim', what='ham'), 'tim likes ham')
424 eq(s.substitute(dict(who='tim'), what='ham'), 'tim likes ham')
425 eq(s.substitute(dict(who='fred', what='kung pao'),
426 who='tim', what='ham'),
440 s = Template('$who likes $what')
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'),
444 who='tim', what='ham'),
463 s = AmpersandTemplate('this &gift is for &{who} &&')
464 eq(s.substitute(gift='bud', who='you'), 'this bud is for you &')
466 eq(s.safe_substitute(gift='bud', who='you'), 'this bud is for you &')
467 eq(s.safe_substitute(), 'this &gift is for &{who} &')
468 s = AmpersandTemplate('this &gift is for &{who} &')
469 raises(ValueError, s.substitute, dict(gift='bud', who='you'))
470 eq(s.safe_substitute(), 'this &gift is for &{who} &')
474 s = PieDelims('@who likes to eat a bag of @{what} worth $100')
475 self.assertEqual(s.substitute(dict(who='tim', what='ham')),
480 s = Template('$who likes to eat a bag of ${what} worth $$100')
483 s = Template('$who likes to eat a bag of ${what} worth $100')
496 s = BadPattern('@bag.foo.who likes to eat a bag of @bag.what')
502 s = Template('$who likes to eat a bag of ${what} worth $$100')
504 eq(ids, ['who', 'what'])
507 s = Template('$who likes to eat a bag of ${what} worth $$100; ${who} likes to eat a bag of $what worth $$100')
509 eq(ids, ['who', 'what'])
512 s = Template('$who likes to eat a bag of ${what} worth $100')
514 eq(ids, ['who', 'what'])
526 s = BadPattern('@bag.foo.who likes to eat a bag of @bag.what')