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

Method test_stringification

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

Source from the content-addressed store, hash-verified

272 eq(s.safe_substitute(d), '%(foo)s baz baz')
273
274 def test_stringification(self):
275 eq = self.assertEqual
276 s = Template('tim has eaten $count bags of ham today')
277 d = dict(count=7)
278 eq(s.substitute(d), 'tim has eaten 7 bags of ham today')
279 eq(s.safe_substitute(d), 'tim has eaten 7 bags of ham today')
280 s = Template('tim has eaten ${count} bags of ham today')
281 eq(s.substitute(d), 'tim has eaten 7 bags of ham today')
282
283 def test_tupleargs(self):
284 eq = self.assertEqual

Callers

nothing calls this directly

Calls 4

substituteMethod · 0.95
safe_substituteMethod · 0.95
TemplateClass · 0.90
eqFunction · 0.85

Tested by

no test coverage detected