test_symboldownloader.py 文件源码

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

项目:tecken 作者: mozilla-services 项目源码 文件源码
def test_has_private_bubble_other_clienterrors(botomock):

    def mock_api_call(self, operation_name, api_params):
        parsed_response = {'Error': {'Code': '403', 'Message': 'Not found'}}
        raise ClientError(parsed_response, operation_name)

    urls = (
        'https://s3.example.com/private/prefix/',
    )
    downloader = SymbolDownloader(urls)
    # Expect this to raise a ClientError because the bucket ('private')
    # doesn't exist. So boto3 would normally trigger a ClientError
    # with a code 'Forbidden'.
    with botomock(mock_api_call):
        with pytest.raises(ClientError):
            downloader.has_symbol(
                'xul.pdb',
                '44E4EC8C2F41492B9369D6B9A059577C2',
                'xul.sym'
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号