betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
567 stars 62 forks source link

Reason attribute missing on reconstructed HTTPResponse objects from urllib3 #83

Closed sigmavirus24 closed 8 years ago

sigmavirus24 commented 8 years ago

Provided something like the following

import requests
import betamax

session = requests.Session()
recorder = betamax.Betamax(session)
with recorder.use_cassette('example'):
    response = session.get('https://httpbin.org/get')

assert response.reason == 'OK'
assert response.status_code == 200

raw = response.raw
assert raw.status == 200
assert raw.reason == 'OK'

The last line will fail because raw.reason is None. It should be the same value as was recorded.

sigmavirus24 commented 8 years ago

@ceaess