Lines Matching defs:read
73 # keep the file around so we can check how much was read from it
105 This is used below to test that http.client doesn't try to read
108 def read(self, n=-1):
109 data = io.BytesIO.read(self, n)
111 raise AssertionError('caller tried to read past EOF')
117 raise AssertionError('caller tried to read past EOF')
680 self.assertEqual(resp.read(0), b'') # Issue #20007
683 self.assertEqual(resp.read(), b"Text")
700 # the same behaviour as when we read the whole thing with read()
705 self.assertEqual(resp.read(2), b'Te')
707 self.assertEqual(resp.read(2), b'xt')
714 # readline() should update the remaining length, so that read() knows
722 self.assertEqual(resp.read(), b'Another')
730 # the same behaviour as when we read the whole thing with read()
754 self.assertEqual(resp.read(10), b'Text')
777 # all data was read
782 self.assertEqual(resp.read(2), b'Te')
784 self.assertEqual(resp.read(2), b'xt')
785 self.assertEqual(resp.read(1), b'')
793 # all data was read
817 self.assertEqual(resp.read(2), b'Te')
819 self.assertEqual(resp.read(2), b'xt')
820 self.assertEqual(resp.read(1), b'')
881 # Test that the library doesn't attempt to read any data
890 if resp.read():
894 # Test that the library doesn't attempt to read any data
954 def read(self, blocksize=-1):
1017 self.assertEqual(resp.read(), expected)
1020 # Various read sizes
1025 self.assertEqual(resp.read(n) + resp.read(n) + resp.read(), expected)
1033 resp.read()
1036 expected_message = 'IncompleteRead(%d bytes read)' % len(expected)
1058 # Various read sizes
1079 expected_message = 'IncompleteRead(%d bytes read)' % len(expected)
1099 self.assertEqual(resp.read(), b'')
1135 self.assertEqual(resp.read(), b'Hello\r\n')
1143 resp.read()
1147 "IncompleteRead(7 bytes read, 3 more expected)")
1149 "IncompleteRead(7 bytes read, 3 more expected)")
1208 self.assertRaises(client.LineTooLong, resp.read)
1216 self.assertEqual(resp.read(), b'')
1245 self.assertEqual(resp.read(), expected)
1254 self.assertEqual(resp.read(), expected)
1258 """See that trailers are read and ignored"""
1263 self.assertEqual(resp.read(), expected)
1265 self.assertEqual(sock.file.read(), b"") #we read to the end
1269 """Check that we don't read past the end of the chunked-encoding stream"""
1275 self.assertEqual(resp.read(), expected)
1276 # the file should now have our extradata ready to be read
1277 self.assertEqual(sock.file.read(), extradata.encode("ascii")) #we read to the end
1281 """Check that we don't read past the end of the Content-Length stream"""
1287 self.assertEqual(resp.read(), expected)
1288 # the file should now have our extradata ready to be read
1289 self.assertEqual(sock.file.read(), extradata) #we read to the end
1299 # the file should now have our extradata ready to be read
1300 self.assertEqual(sock.file.read(), extradata) #we read to the end
1310 # the file should now have our extradata ready to be read
1311 self.assertEqual(sock.file.read(), extradata) #we read to the end
1322 # the file should now have our extradata ready to be read
1323 self.assertEqual(sock.file.read(), extradata) #we read to the end
1333 self.assertEqual(resp.read(), expected)
1334 # the file should now have our extradata ready to be read
1335 self.assertEqual(sock.file.read(), extradata) #we read to the end
1354 result = reader.read()
1474 next = resp.read(len(p2))
1477 next = resp.read()
1563 a simple readline class that uses an arbitrary read function and buffering
1572 read = self.remainder
1575 idx = read.find(b'\n')
1578 if datalen + len(read) >= limit:
1580 # read more data
1581 data.append(read)
1582 read = self.readfunc()
1583 if not read:
1587 data.append(read[:idx])
1588 self.remainder = read[idx:]
1783 response.read()
2042 f.readline() # read the request line
2064 self.assertEqual(expected, f.read())
2073 self.assertEqual(4, len(f.read()))
2081 self.assertEqual(b'body', f.read())
2089 self.assertEqual(b'body\xc1', f.read())
2097 self.assertEqual(b'body\xc1', f.read())
2112 self.assertEqual(b'4\r\nbody\r\n0\r\n\r\n', f.read())
2125 self.assertEqual(b'5\r\nbody\xc1\r\n0\r\n\r\n', f.read())