本文整理汇总了Python中collector.lib.util.DotDict.bucket_name方法的典型用法代码示例。如果您正苦于以下问题:Python DotDict.bucket_name方法的具体用法?Python DotDict.bucket_name怎么用?Python DotDict.bucket_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collector.lib.util.DotDict
的用法示例。
在下文中一共展示了DotDict.bucket_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_mocked_s3_storage
# 需要导入模块: from collector.lib.util import DotDict [as 别名]
# 或者: from collector.lib.util.DotDict import bucket_name [as 别名]
def setup_mocked_s3_storage(
self,
executor=TransactionExecutor,
executor_for_gets=TransactionExecutor,
storage_class='BotoS3CrashStorage',
host='',
port=0):
config = DotDict({
'source': {
'dump_field': 'dump'
},
'transaction_executor_class': executor,
'transaction_executor_class_for_get': executor_for_gets,
'resource_class': S3ConnectionContext,
'keybuilder_class': KeyBuilderBase,
'backoff_delays': [0, 0, 0],
'redactor_class': Redactor,
'forbidden_keys': Redactor.required_config.forbidden_keys.default,
'logger': mock.Mock(),
'host': host,
'port': port,
'access_key': 'this is the access key',
'secret_access_key': 'secrets',
'temporary_file_system_storage_path': self.TEMPDIR,
'dump_file_suffix': '.dump',
'bucket_name': 'mozilla-support-reason',
'prefix': 'dev',
'calling_format': mock.Mock()
})
if storage_class == 'BotoS3CrashStorage':
config.bucket_name = 'crash_storage'
s3 = BotoS3CrashStorage(config)
elif storage_class == 'SupportReasonAPIStorage':
s3 = SupportReasonAPIStorage(config)
s3_conn = s3.connection_source
s3_conn._connect_to_endpoint = mock.Mock()
s3_conn._mocked_connection = s3_conn._connect_to_endpoint.return_value
s3_conn._calling_format.return_value = mock.Mock()
s3_conn._CreateError = mock.Mock()
## s3_conn.ResponseError = mock.Mock()
s3_conn._open = mock.MagicMock()
return s3