ResponseSocket

class pytest_response.interceptors._urllib.ResponseSocket(host, port, *args, **kwargs)[source]

Bases: socket

Socket implementation of Pytest-Response

Provides ResponseSocket.makefile method to return a buffer built with ResponseSocketIO

Methods Summary

close()

Close the socket.

connect(*args, **kwargs)

Connects to host in capturing mode otherwise passes.

makefile([mode, buffering, encoding, ...])

Provides makefile() method which returns a Buffered IO built with ResponseSocketIO

sendall(data, *args, **kwargs)

Wrapper for _socket.socket.sendall

Methods Documentation

close()[source]

Close the socket. It cannot be used after this call.

connect(*args, **kwargs)[source]

Connects to host in capturing mode otherwise passes.

Wrapper for _socket.socket.connect

makefile(mode='r', buffering=None, encoding=None, errors=None, newline=None, *args, **kwargs)[source]

Provides makefile() method which returns a Buffered IO built with ResponseSocketIO

sendall(data, *args, **kwargs)[source]

Wrapper for _socket.socket.sendall