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

Method test_append

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

Source from the content-addressed store, hash-verified

1907 self.assertRaises(AttributeError, lambda: bytearray().sort())
1908
1909 def test_append(self):
1910 b = bytearray(b'hell')
1911 b.append(ord('o'))
1912 self.assertEqual(b, b'hello')
1913 self.assertEqual(b.append(100), None)
1914 b = bytearray()
1915 b.append(ord('A'))
1916 self.assertEqual(len(b), 1)
1917 self.assertRaises(TypeError, lambda: b.append(b'o'))
1918 b = bytearray()
1919 b.append(Indexable(ord('A')))
1920 self.assertEqual(b, b'A')
1921
1922 def test_insert(self):
1923 b = bytearray(b'msssspp')

Callers

nothing calls this directly

Calls 4

IndexableClass · 0.70
appendMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected