MCPcopy Index your code
hub / github.com/python/cpython / test_escapes

Method test_escapes

Lib/test/test_string/test_string.py:259–265  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

257 self.assertEqual(s.substitute(d), 'tim likes ham for dinner')
258
259 def test_escapes(self):
260 eq = self.assertEqual
261 s = Template('$who likes to eat a bag of $$what worth $$100')
262 eq(s.substitute(dict(who='tim', what='ham')),
263 'tim likes to eat a bag of $what worth $100')
264 s = Template('$who likes $$')
265 eq(s.substitute(dict(who='tim', what='ham')), 'tim likes $')
266
267 def test_percents(self):
268 eq = self.assertEqual

Callers

nothing calls this directly

Calls 3

substituteMethod · 0.95
TemplateClass · 0.90
eqFunction · 0.85

Tested by

no test coverage detected