Package: requestests
# RequestestsThis is an testing/validation extension on top of the ever-so-popular [requests library](https://github.com/kennethreitz/requests). The library relies on duck typing to add testability of a response object. Given that, leveraging the validation mechanism inrequestestsis both lightweight and simple!## InstallationThe library can be installed via:pip install requestests## UsageUsing the built-in validations inrequestestsis intended to be an extremely intuitive extension of usingrequests:>>> import requestests
>>> r = requestests.get('https://api.github.com/user', auth=('user', 'pass'))
>>> r.validate_code(requests.code.ok)
>>> r.validate_header_like('Content-Type', 'application/json')
>>> r.encoding
'utf-8'
>>> r.text
u'{"type":"User"...'
>>> r.json()
{u'disk_usage': 368627, u'private_gists': 484, ...}What is happening is that the assertion operation is being abstracted out. The traditional method of asserting on the response:r = requests.get(’https://api.github.com/user’)
assert r.status_code == requests.codes.ok, “Expecting a 200 response code”can be simplified to this:r = requestests.get(’https://api.github.com.user’)
r.validate_code(requests.code.ok)## Or even to this
r = requestests.get(’https://api.github.com.user’).validate_code(requests.code.ok)Validations follow the builder paradigm, so operations can be chained together:entity = requestests.get(’https://api.github.com.user’).validate_code(requests.code.ok) .validate_header_like(‘Content-Type’, ‘application/json’) .json()What happens in this scenario is that if any of the validations fails, anAssertionErroris raised; otherwise, at the end of this requests, you would have:Validated that the request was successfulValidated the ‘Content-Type’ is ‘application/json’and deserialized the response.text## DocumentationThe projects homepage can be found [here](https://github.com/gradeawarrior/requestests).## Package Dependencies:[requests](https://github.com/kennethreitz/requests) - Requests is the only Non-GMO HTTP library for Python, safe for human consumption[jsonstruct](https://github.com/initialxy/jsonstruct) - jsonstruct is a library for two way conversion of typed Python object and JSON# CopyrightCopyright (c) 2016 Peter Salas. See LICENSE for
further details.Release History### 1.2.2 (2017-01-09)New FeaturesFixing major issue with installing requestests v1.2.1 from PyPi server### 1.2.1 (2017-01-09)New FeaturesFixing major issue with installing requestests v1.2.0 from PyPi serverUpdates to licensing information### 1.2.0 (2016-11-16)New FeaturesMigration of ownership to personal Github account for continued support and enhancementsUpdate of documentation for easier readability on both github and pypiDevelopment enhancements to use virtualenv versus system python environment### 1.1.2 (2016-09-29)New FeaturesA more comprehensive set of Validation methods for evaluating things like (i) response codes, (ii) response content, (iii) response headers, and (iv) time-to-last-byte (ttlb)Adding better assertion debug messages for determining what failed and why. For example:http://www.google.com/foobar - 200 == 301, which basically means that the request tohttp://www.google.com/foobarfailed because we were expecting200but got a301Adding several unit-tests for ensuring the code continues to work### 1.0.0 (2016-06-01)New FeaturesFirst release of requestests testing tool for the world