test_app.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:chalice 作者: aws 项目源码 文件源码
def test_handles_binary_responses(body, content_type):
    r = Response(body=body, headers={'Content-Type': content_type})
    serialized = r.to_dict(BINARY_TYPES)
    # A binary response should always result in the
    # response being base64 encoded.
    assert serialized['isBase64Encoded']
    assert isinstance(serialized['body'], six.string_types)
    assert isinstance(base64.b64decode(serialized['body']), bytes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号