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

Method test_basic_formatter

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

Source from the content-addressed store, hash-verified

41 self.assertEqual(string.capwords('\taBc\tDeF\t', '\t'), '\tAbc\tDef\t')
42
43 def test_basic_formatter(self):
44 fmt = string.Formatter()
45 self.assertEqual(fmt.format("foo"), "foo")
46 self.assertEqual(fmt.format("foo{0}", "bar"), "foobar")
47 self.assertEqual(fmt.format("foo{1}{0}-{1}", "bar", 6), "foo6bar-6")
48 self.assertRaises(TypeError, fmt.format)
49 self.assertRaises(TypeError, string.Formatter.format)
50
51 def test_format_keyword_arguments(self):
52 fmt = string.Formatter()

Callers

nothing calls this directly

Calls 3

formatMethod · 0.95
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected