patrys / httmock

A mocking library for requests
Other
468 stars 57 forks source link

Allow content=None when stream=True #46

Open cancan101 opened 8 years ago

cancan101 commented 8 years ago

Right now if content=None when stream=True, then you get:

  File "/Users/alex/.virtualenvs/media/lib/python2.7/site-packages/httmock.py", line 194, in intercept
    stream=kwargs.get('stream', False))
  File "/Users/alex/.virtualenvs/media/lib/python2.7/site-packages/httmock.py", line 63, in response
    res.raw = BytesIO(content)
TypeError: must be string or buffer, not None