def nested_context_managers(): with get(httpbin('get')): assert response.request.method == 'GET' with post(httpbin('post')): assert response.request.method == 'POST' assert response.request.method == 'GET'
def main(args): with get(api('/repos/gsamokovarov/frames.py/contributors')): for metadata in response.json: print '%(login)s: %(contributions)d commits' % metadata
def response_proxies_property_descriptors(): with get(httpbin('get')): assert response.ok == True assert response.json['url'] == httpbin('get')