Lines Matching refs:sock
148 conn.sock = FakeSocket('blahblahblah')
176 conn.sock = FakeSocket(None)
192 conn.sock = FakeSocket(None)
205 conn.sock = FakeSocket(None)
216 conn.sock = FakeSocket(None)
226 conn.sock = FakeSocket(None)
264 sock = FakeSocket('')
265 conn.sock = sock
267 self.assertTrue(sock.data.startswith(expected))
272 sock = FakeSocket('')
273 conn.sock = sock
275 self.assertTrue(sock.data.startswith(expected))
280 sock = FakeSocket(body)
281 resp = client.HTTPResponse(sock)
300 sock = FakeSocket(body)
301 resp = client.HTTPResponse(sock)
319 conn.sock = FakeSocket('')
353 sock = FakeSocket(body)
354 resp = client.HTTPResponse(sock, debuglevel=1)
368 conn.sock = FakeSocket(b'')
372 _, _, body = self._parse_request(conn.sock.data)
379 conn.sock = FakeSocket(b'')
385 _, headers, body = self._parse_request(conn.sock.data)
392 conn.sock = FakeSocket(b'')
397 _, headers, body = self._parse_request(conn.sock.data)
404 conn.sock = FakeSocket(b'')
409 _, headers, body = self._parse_request(conn.sock.data)
417 conn.sock = FakeSocket(b'')
421 _, headers, body = self._parse_request(conn.sock.data)
433 conn.sock = FakeSocket(b'')
435 _, headers, body = self._parse_request(conn.sock.data)
496 sock = FakeSocket(body)
497 resp = client.HTTPResponse(sock)
509 sock = FakeSocket(body)
510 resp = client.HTTPResponse(sock)
521 sock = FakeSocket(body)
522 resp = client.HTTPResponse(sock)
536 sock = FakeSocket(body)
537 resp = client.HTTPResponse(sock)
551 sock = FakeSocket(body)
552 resp = client.HTTPResponse(sock)
571 sock = FakeSocket(body)
572 resp = client.HTTPResponse(sock)
587 sock = FakeSocket(body)
588 resp = client.HTTPResponse(sock)
606 sock = FakeSocket(body)
607 resp = client.HTTPResponse(sock)
619 sock = FakeSocket(body)
620 resp = client.HTTPResponse(sock)
675 sock = FakeSocket(
680 resp = client.HTTPResponse(sock, method="HEAD")
688 sock = FakeSocket(
693 resp = client.HTTPResponse(sock, method="HEAD")
717 sock = FakeSocket(body)
718 conn.sock = sock
720 self.assertTrue(sock.data.startswith(expected), '%r != %r' %
721 (sock.data[:len(expected)], expected))
726 sock = FakeSocket(None)
727 conn.sock = sock
729 self.assertEqual(expected, sock.data)
730 sock.data = b''
732 self.assertEqual(expected, sock.data)
733 sock.data = b''
735 self.assertEqual(expected, sock.data)
752 sock = FakeSocket("")
753 conn.sock = sock
755 self.assertEqual(sock.data, expected)
769 sock = FakeSocket("")
770 conn.sock = sock
772 self.assertEqual(sock.data, expected)
778 sock = FakeSocket(None)
779 conn.sock = sock
782 self.assertEqual(sock.sendall_calls, 3)
783 body = sock.data.split(b"\r\n\r\n", 1)[1]
790 sock = FakeSocket(None)
791 conn.sock = sock
794 self.assertEqual(sock.sendall_calls, 2)
795 self.assertEqual(sock.data, expected)
800 conn.sock = FakeSocket('')
806 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
807 resp = client.HTTPResponse(sock, method="GET")
814 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
815 resp = client.HTTPResponse(sock, method="GET")
821 sock = FakeSocket(chunked_start + x)
822 resp = client.HTTPResponse(sock, method="GET")
842 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
843 resp = client.HTTPResponse(sock, method="GET")
852 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
853 resp = client.HTTPResponse(sock, method="GET")
864 sock = FakeSocket(chunked_start + x)
865 resp = client.HTTPResponse(sock, method="GET")
888 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
889 resp = client.HTTPResponse(sock, method="HEAD")
908 sock = FakeSocket(chunked_start + last_chunk + chunked_end)
909 resp = client.HTTPResponse(sock, method="HEAD")
923 sock = FakeSocket(
925 resp = client.HTTPResponse(sock, method="GET")
931 sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\nHello\r\n')
932 resp = client.HTTPResponse(sock, method="GET")
947 sock = EPipeSocket(
953 conn.sock = sock
992 sock = FakeSocket(body)
993 resp = client.HTTPResponse(sock)
1011 conn.sock = FakeSocket('Invalid status line')
1015 self.assertTrue(conn.sock.file_closed)
1021 sock = FakeSocket(chunked_start + extra + last_chunk_extended + chunked_end)
1022 resp = client.HTTPResponse(sock, method="GET")
1030 sock = FakeSocket(chunked_start + last_chunk) #no terminating crlf
1031 resp = client.HTTPResponse(sock, method="GET")
1039 sock = FakeSocket(chunked_start + last_chunk + trailers + chunked_end)
1040 resp = client.HTTPResponse(sock, method="GET")
1044 self.assertEqual(sock.file.read(), b"") #we read to the end
1051 sock = FakeSocket(chunked_start + last_chunk + trailers + chunked_end + extradata)
1052 resp = client.HTTPResponse(sock, method="GET")
1056 self.assertEqual(sock.file.read(), extradata.encode("ascii")) #we read to the end
1063 sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\n' + expected + extradata)
1064 resp = client.HTTPResponse(sock, method="GET")
1068 self.assertEqual(sock.file.read(), extradata) #we read to the end
1074 sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\n' + expected + extradata)
1075 resp = client.HTTPResponse(sock, method="GET")
1079 self.assertEqual(sock.file.read(), extradata) #we read to the end
1085 sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\n' + expected + extradata)
1086 resp = client.HTTPResponse(sock, method="GET")
1090 self.assertEqual(sock.file.read(), extradata) #we read to the end
1096 sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\n' + expected + extradata)
1097 resp = client.HTTPResponse(sock, method="GET")
1102 self.assertEqual(sock.file.read(), extradata) #we read to the end
1108 sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 30\r\n\r\n' + expected*3 + extradata)
1109 resp = client.HTTPResponse(sock, method="GET")
1114 self.assertEqual(sock.file.read(), extradata) #we read to the end
1188 sock = FakeSocket(self.lines)
1189 resp = client.HTTPResponse(sock, method="GET")
1437 self.assertEqual(self.conn.sock.getsockname()[1], self.source_port)
1473 self.assertEqual(httpConn.sock.gettimeout(), 30)
1485 self.assertEqual(httpConn.sock.gettimeout(), None)
1491 self.assertEqual(httpConn.sock.gettimeout(), 30)
1517 self.assertIsNone(conn.sock)
1520 self.assertEqual(conn.sock is None, not reuse)
1522 self.assertEqual(conn.sock is None, not reuse)
1549 self.assertIsNone(conn.sock)
1562 self.assertIsNone(conn.sock)
1738 self.conn.sock = self.sock = FakeSocket("")
1739 self.conn.sock = self.sock
1742 f = io.BytesIO(self.sock.data)
1758 self.conn.sock = self.sock = FakeSocket('')
1834 sock = FakeSocket(body)
1835 self.resp = client.HTTPResponse(sock)
1890 self.assertEqual(self.conn.sock.host, self.host)
1891 self.assertEqual(self.conn.sock.port, client.HTTP_PORT)
1905 self.assertEqual(self.conn.sock.host, self.host)
1906 self.assertEqual(self.conn.sock.port, client.HTTP_PORT)
1907 self.assertIn(b'CONNECT destination.com', self.conn.sock.data)
1909 self.assertNotIn(b'Host: destination.com:None', self.conn.sock.data)
1910 self.assertIn(b'Host: destination.com', self.conn.sock.data)
1913 self.assertNotIn(b'Host: proxy.com', self.conn.sock.data)
1918 self.assertEqual(self.conn.sock.host, self.host)
1919 self.assertEqual(self.conn.sock.port, client.HTTP_PORT)
1920 self.assertIn(b'CONNECT destination.com', self.conn.sock.data)
1921 self.assertIn(b'Host: destination.com', self.conn.sock.data)