Pass an existing socket to requests

* Add TestSocket.