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

Method test_center

Lib/test/test_bytes.py:970–975  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

968 self.assertRaises(TypeError, self.type2test(b' abc ').rstrip, 32)
969
970 def test_center(self):
971 # Fill character can be either bytes or bytearray (issue 12380)
972 b = self.type2test(b'abc')
973 for fill_type in (bytes, bytearray):
974 self.assertEqual(b.center(7, fill_type(b'-')),
975 self.type2test(b'--abc--'))
976
977 def test_ljust(self):
978 # Fill character can be either bytes or bytearray (issue 12380)

Callers

nothing calls this directly

Calls 3

type2testMethod · 0.80
assertEqualMethod · 0.45
centerMethod · 0.45

Tested by

no test coverage detected