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

Method test_copied

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

Source from the content-addressed store, hash-verified

1932 self.assertEqual(b, b'A')
1933
1934 def test_copied(self):
1935 # Issue 4348. Make sure that operations that don't mutate the array
1936 # copy the bytes.
1937 b = bytearray(b'abc')
1938 self.assertIsNot(b, b.replace(b'abc', b'cde', 0))
1939
1940 t = bytearray([i for i in range(256)])
1941 x = bytearray(b'')
1942 self.assertIsNot(x, x.translate(t))
1943
1944 def test_partition_bytearray_doesnt_share_nullstring(self):
1945 a, b, c = bytearray(b"x").partition(b"y")

Callers

nothing calls this directly

Calls 3

assertIsNotMethod · 0.80
replaceMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected