Home | History | Annotate | Download | only in test

Lines Matching refs:who

25         s = Template('$who likes to eat a bag of $what worth $$100')
26 self.assertEqual(s.substitute(dict(who='tim', what='ham')),
28 self.assertRaises(KeyError, s.substitute, dict(who='tim'))
31 s = Template('$who likes ${what} for ${meal}')
32 d = dict(who='tim', what='ham', meal='dinner')
35 dict(who='tim', what='ham'))
39 s = Template('$who likes to eat a bag of $$what worth $$100')
40 eq(s.substitute(dict(who='tim', what='ham')),
42 s = Template('$who likes $$')
43 eq(s.substitute(dict(who='tim', what='ham')), 'tim likes $')
63 s = Template('$who ate ${meal}')
64 d = dict(who=('tim', 'fred'), meal=('ham', 'kung pao'))
70 s = Template('$who likes ${what} for ${meal}')
71 eq(s.safe_substitute(dict(who='tim')), 'tim likes ${what} for ${meal}')
72 eq(s.safe_substitute(dict(what='ham')), '$who likes ham for ${meal}')
74 '$who likes ham for dinner')
75 eq(s.safe_substitute(dict(who='tim', what='ham')),
77 eq(s.safe_substitute(dict(who='tim', what='ham', meal='dinner')),
82 s = Template('$who likes $')
83 raises(ValueError, s.substitute, dict(who='tim'))
84 s = Template('$who likes ${what)')
85 raises(ValueError, s.substitute, dict(who='tim'))
86 s = Template('$who likes $100')
87 raises(ValueError, s.substitute, dict(who='tim'))
95 m.bag.foo.who = 'tim'
97 s = PathPattern('$bag.foo.who likes to eat a bag of $bag.what')
111 m.bag.foo.who = 'tim'
113 s = MyPattern('@bag.foo.who likes to eat a bag of @bag.what')
124 s = BadPattern('@bag.foo.who likes to eat a bag of @bag.what')
129 s = Template('$who likes $what')
130 d = dict(who=u't\xffm', what=u'f\xfe\fed')
135 s = Template('$who likes $what')
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'),
139 who='tim', what='ham'),
150 s = Template('$who likes $what')
151 eq(s.safe_substitute(who='tim', what='ham'), 'tim likes ham')
152 eq(s.safe_substitute(dict(who='tim'), what='ham'), 'tim likes ham')
153 eq(s.safe_substitute(dict(who='fred', what='kung pao'),
154 who='tim', what='ham'),
170 s = AmpersandTemplate('this &gift is for &{who} &&')
171 eq(s.substitute(gift='bud', who='you'), 'this bud is for you &')
173 eq(s.safe_substitute(gift='bud', who='you'), 'this bud is for you &')
174 eq(s.safe_substitute(), 'this &gift is for &{who} &')
175 s = AmpersandTemplate('this &gift is for &{who} &')
176 raises(ValueError, s.substitute, dict(gift='bud', who='you'))
177 eq(s.safe_substitute(), 'this &gift is for &{who} &')
181 s = PieDelims('@who likes to eat a bag of @{what} worth $100')
182 self.assertEqual(s.substitute(dict(who='tim', what='ham')),