コード例 #1
0
ファイル: test_app.py プロジェクト: abdullah353/chalice
def test_raw_body_is_none_if_body_is_none():
    misc_kwargs = {
        'query_params': {},
        'headers': {},
        'uri_params': {},
        'method': 'GET',
        'context': {},
        'stage_vars': {},
        'is_base64_encoded': False,
    }
    request = app.Request(body=None, **misc_kwargs)
    assert request.raw_body == b''
コード例 #2
0
ファイル: test_app.py プロジェクト: abdullah353/chalice
def create_request_with_content_type(content_type):
    body = '{"json": "body"}'
    return app.Request(
        {}, {'Content-Type': content_type}, {}, 'GET',
        body, {}, {}, False
    )
コード例 #3
0
ファイル: test_app.py プロジェクト: wesleysee/chalice
def create_request_with_content_type(content_type):
    body = {'json': 'body'}
    return app.Request({}, {'Content-Type': content_type}, {}, 'GET', body, '',
                       {}, {}, {})