MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_copied

Method test_copied

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

Source from the content-addressed store, hash-verified

1728 self.assertEqual(b, b'A')
1729
1730 def test_copied(self):
1731 # Issue 4348. Make sure that operations that don't mutate the array
1732 # copy the bytes.
1733 b = bytearray(b'abc')
1734 self.assertIsNot(b, b.replace(b'abc', b'cde', 0))
1735
1736 t = bytearray([i for i in range(256)])
1737 x = bytearray(b'')
1738 self.assertIsNot(x, x.translate(t))
1739
1740 def test_partition_bytearray_doesnt_share_nullstring(self):
1741 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