• Home
  • Raw
  • Download

Lines Matching refs:bytearray

200             bytearray(size - 4)
360 for f in bytes, bytearray:
377 b = bytearray([0x1a, 0x2b, 0x30])
414 self.assertEqual(bytearray([0x1a, 0x2b, 0x30]).hex(), '1a2b30')
430 self.assertEqual(dot_join([bytearray(b"ab"), b"cd"]), b"ab.:cd")
431 self.assertEqual(dot_join([b"ab", bytearray(b"cd")]), b"ab.:cd")
440 dot_join([bytearray(b"ab"), "cd", b"ef"])
483 self.assertFalse(bytearray().endswith(b"anything"))
707 for fill_type in (bytes, bytearray):
714 for fill_type in (bytes, bytearray):
721 for fill_type in (bytes, bytearray):
819 rosetta = bytearray(range(256))
1032 class BufferBlocked(bytearray):
1034 ba, bb = bytearray(b'ab'), BufferBlocked(b'ab')
1040 type2test = bytearray
1045 bytearray(b'python')['a']
1050 b = bytearray(b'python')
1054 self.assertRaises(TypeError, hash, bytearray())
1066 b = bytearray(20)
1083 b = bytearray(b'hello')
1086 b = bytearray(b'hello1') # test even number of items
1089 b = bytearray()
1094 b = bytearray(b'python')
1098 b = bytearray(b'')
1102 b = bytearray(b'')
1109 b = bytearray(b'abc')
1113 b = bytearray(b'')
1118 b = bytearray(b'abc')
1128 return bytearray(map(ord, s))
1133 b = bytearray([1, 2, 3])
1135 self.assertEqual(b, bytearray([1, 100, 3]))
1137 self.assertEqual(b, bytearray([1, 100, 200]))
1139 self.assertEqual(b, bytearray([10, 100, 200]))
1167 b = bytearray(range(10))
1169 self.assertEqual(b, bytearray(range(1, 10)))
1171 self.assertEqual(b, bytearray(range(1, 9)))
1173 self.assertEqual(b, bytearray([1, 2, 3, 4, 6, 7, 8]))
1176 b = bytearray(range(10))
1179 b[0:5] = bytearray([1, 1, 1, 1, 1])
1180 self.assertEqual(b, bytearray([1, 1, 1, 1, 1, 5, 6, 7, 8, 9]))
1183 self.assertEqual(b, bytearray([5, 6, 7, 8, 9]))
1185 b[0:0] = bytearray([0, 1, 2, 3, 4])
1186 self.assertEqual(b, bytearray(range(10)))
1188 b[-7:-3] = bytearray([100, 101])
1189 self.assertEqual(b, bytearray([0, 1, 2, 100, 101, 7, 8, 9]))
1192 self.assertEqual(b, bytearray(range(10)))
1195 self.assertEqual(b, bytearray([0, 1, 2, 42, 42, 42, 3, 4, 5, 6, 7, 8, 9]))
1198 self.assertEqual(b, bytearray([0, 1, 2, 102, 111, 111]))
1201 self.assertEqual(b, bytearray([102, 111, 111, 102, 111, 111]))
1204 self.assertEqual(b, bytearray([102, 111, 111, 111, 111]))
1217 b = bytearray(range(100))
1227 b = bytearray(10)
1235 b = bytearray(10)
1247 b = bytearray(L)
1254 self.assertEqual(b, bytearray(L))
1258 self.assertEqual(b, bytearray(L))
1263 b = bytearray(range(256))
1265 self.assertEqual(b, bytearray(list(range(8)) + list(range(256))))
1268 b = bytearray(b"abc")
1284 b = bytearray(b"abc")
1292 b = bytearray(b"x")
1300 b = bytearray()
1312 b = bytearray()
1330 a = bytearray(orig)
1334 a = bytearray(b'')
1340 a = bytearray(b'')
1344 a = bytearray(b'')
1348 a = bytearray(b'')
1352 a = bytearray(b'')
1357 b = bytearray(b'hello')
1374 c = bytearray([126, 127, 128, 129])
1381 b = bytearray(b'world')
1386 self.assertRaises(IndexError, lambda: bytearray().pop())
1388 self.assertEqual(bytearray(b'\xff').pop(), 0xff)
1391 self.assertRaises(AttributeError, lambda: bytearray().sort())
1394 b = bytearray(b'hell')
1398 b = bytearray()
1402 b = bytearray()
1407 b = bytearray(b'msssspp')
1414 b = bytearray()
1421 b = bytearray(b'abc')
1424 t = bytearray([i for i in range(256)])
1425 x = bytearray(b'')
1429 a, b, c = bytearray(b"x").partition(b"y")
1435 a, b, c = bytearray(b"x").partition(b"y")
1439 b, c, a = bytearray(b"x").rpartition(b"y")
1445 c, b, a = bytearray(b"x").rpartition(b"y")
1454 b = bytearray(range(10))
1484 self.assertRaises(BufferError, getbuffer_with_null_view, bytearray())
1487 orig = bytearray(b'abc')
1526 ba = bytearray(b'ab')
1542 self.assertEqual(f(bytearray()), "bytearray(b'')")
1543 self.assertEqual(f(bytearray([0])), "bytearray(b'\\x00')")
1544 self.assertEqual(f(bytearray([0, 1, 254, 255])),
1552 for b in b'abc', bytearray(b'abc'):
1590 self.assertIsNotNone(bytearray.__doc__)
1591 self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
1598 b = bytearray(buf)
1599 self.assertEqual(b, bytearray(sample))
1606 self.assertEqual(str(bytearray(b'')), "bytearray(b'')")
1607 self.assertEqual(str(bytearray(b'x')), "bytearray(b'x')")
1608 self.assertEqual(str(bytearray(b'\x80')), "bytearray(b'\\x80')")
1618 self.assertEqual(b, bytearray(s, 'latin-1'))
1631 b = bytearray()
1648 bytearray(b'') == ''
1650 '' == bytearray(b'')
1652 bytearray(b'') != ''
1654 '' != bytearray(b'')
1681 return bytearray(x)
1715 type2test = bytearray
1814 class ByteArraySubclass(bytearray):
1824 basetype = bytearray
1828 class subclass(bytearray):
1830 bytearray.__init__(me, *args, **kwargs)