patrys / httmock

A mocking library for requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow content=None when stream=True

cancan101 opened this issue · comments

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