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

Method test_percents

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

Source from the content-addressed store, hash-verified

265 eq(s.substitute(dict(who='tim', what='ham')), 'tim likes $')
266
267 def test_percents(self):
268 eq = self.assertEqual
269 s = Template('%(foo)s $foo ${foo}')
270 d = dict(foo='baz')
271 eq(s.substitute(d), '%(foo)s baz baz')
272 eq(s.safe_substitute(d), '%(foo)s baz baz')
273
274 def test_stringification(self):
275 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