コード例 #1
0
ファイル: test.py プロジェクト: gsamokovarov/response.py
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'
コード例 #2
0
def main(args):
    with get(api('/repos/gsamokovarov/frames.py/contributors')):
        for metadata in response.json:
            print '%(login)s: %(contributions)d commits' % metadata
コード例 #3
0
ファイル: test.py プロジェクト: gsamokovarov/response.py
def response_proxies_property_descriptors():
    with get(httpbin('get')):
        assert response.ok == True
        assert response.json['url'] == httpbin('get')
コード例 #4
0
def main(args):
    with get(api('/repos/gsamokovarov/frames.py/contributors')):
        for metadata in response.json:
            print '%(login)s: %(contributions)d commits' % metadata