I'm currently using python_flickr_api to upload photos for my app: it uses httplib to perform a multipart POST request.
Problem: I want to verify that the upload really is issued in an integration test by intercepting the POST request and creating a pre-canned success response so that my tests can run completely offline and not depend on Flickr (I don't want to upload the same test image 100 times, either!)
To this end, I've tried using two incredible libraries: VCRPy and HTTPretty. Neither of them solves my problem because neither of them support httplib (HTTPretty comes closest, with support for httplib2 only), and I get an error that looks something like this: 
 Failure/Error: [Errno 32] Broken pipe
 Traceback:
 ...
 File "/usr/local/lib/python2.7/site-packages/flickr_api/upload.py", line 92, in upload
     r = post(UPLOAD_URL,auth.AUTH_HANDLER,args,photo_file)
 File "/usr/local/lib/python2.7/site-packages/flickr_api/upload.py", line 52, in post
     r = multipart.posturl(url,fields,files)
 File "/usr/local/lib/python2.7/site-packages/flickr_api/multipart.py", line 19, in posturl
     return post_multipart(urlparts[1], urlparts[2], fields,files)
 File "/usr/local/lib/python2.7/site-packages/flickr_api/multipart.py", line 33, in post_multipart
     h.send(body)
 File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 805, in send
     self.sock.sendall(data)
 File "/usr/local/lib/python2.7/site-packages/httpretty/core.py", line 243, in sendall
     return self._true_sendall(data)
 File "/usr/local/lib/python2.7/site-packages/httpretty/core.py", line 216, in _true_sendall
     self.truesock.sendall(data, *args, **kw)
 File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth
     return getattr(self._sock,name)(*args)
So clearly httpretty is intercepting but is causing a broken pipe.
How can I fix this?