Lines Matching refs:bytes

10 # * test_largefile - tests operations on a file greater than 2**32 bytes
57 return array.array("b", bytes(*pos, **kw))
60 """Create a bytes-like object having no string or sequence methods"""
61 data = bytes(*pos, **kw)
95 self._write_stack.append(bytes(b))
291 b = bytes(b)
354 self.assertEqual(bytes(data), b" worl")
380 self.assertEqual(bytes(data), b"hello")
541 bytes_fn = bytes(fn_with_NUL, 'ascii')
615 'test requires %s bytes and a long time to run' % self.LARGE)
932 self.assertEqual(bytes(buffer), b"12345")
981 """Returns no more than 5 bytes at once"""
1001 reader = Reader(bytes(range(avail)))
1375 # Read into it. We should get as many *bytes* as we can fit into b
1396 # Read into it. We should get as many *bytes* as we can fit into b
1466 # Write out many bytes with exactly the same number of 0's,
1472 s = bytes(bytearray(l))
1498 c = bytes(bytearray([i]))
1683 # At least (total - 8) bytes were implicitly flushed, perhaps more
1689 contents = bytes(range(256)) * 1000
1740 # 8 bytes will be written, 8 will be buffered and the rest will be lost
1754 # Previously buffered bytes were flushed
1841 # Write out many bytes from many threads and test they were
1844 contents = bytes(range(256)) * N
1881 self.assertEqual(s.count(bytes([i])), N)
2046 self.assertEqual(bytes(data), b"abcde")
2260 return bytes(b[:n])
2453 # - A single output character can correspond to many bytes of input.
2454 # - The number of input bytes to complete the character can be
2456 # - The number of input bytes can vary depending on previous input.
2494 return bytes(self.buffer), i*100 + o
2511 else: # fixed-length, terminate after self.i bytes
2820 # XXX: str.encode() should return bytes
2821 data = bytes(''.join(input_lines).encode(encoding))
3004 prefix = bytes(u_prefix.encode("utf-8"))
3007 suffix = bytes(u_suffix.encode("utf-8"))
3463 # Crash when underlying read() returns non-bytes
3716 rather than bytes'''
3725 '''Convert bytes-object *buf* to a non-trivial memoryview'''
3799 # default chunk size is 8192 bytes so t don't write data to buf.
3867 result.append(decoder.decode(bytes([b])))
3896 # rather than bytes input
4193 msg = bytes([i % 26 + 97]) * N
4407 def check_interrupted_write(self, item, bytes, **fdopen_kwargs):
4471 self.assertEqual(read_results, [bytes[0:1], bytes[1:2]])