本文整理汇总了Python中awscli.customizations.s3.subcommands.CommandParameters.add_paths方法的典型用法代码示例。如果您正苦于以下问题:Python CommandParameters.add_paths方法的具体用法?Python CommandParameters.add_paths怎么用?Python CommandParameters.add_paths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类awscli.customizations.s3.subcommands.CommandParameters
的用法示例。
在下文中一共展示了CommandParameters.add_paths方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_validate_sse_c_args_missing_sse_c_copy_source_key
# 需要导入模块: from awscli.customizations.s3.subcommands import CommandParameters [as 别名]
# 或者: from awscli.customizations.s3.subcommands.CommandParameters import add_paths [as 别名]
def test_validate_sse_c_args_missing_sse_c_copy_source_key(self):
paths = ['s3://bucket/foo', 's3://bucket/bar']
params = {'dir_op': False, 'sse_c_copy_source': 'AES256'}
cmd_param = CommandParameters('cp', params, '')
with self.assertRaisesRegexp(ValueError,
'--sse-c-copy-source-key must be specified'):
cmd_param.add_paths(paths)
示例2: test_validate_streaming_paths_download
# 需要导入模块: from awscli.customizations.s3.subcommands import CommandParameters [as 别名]
# 或者: from awscli.customizations.s3.subcommands.CommandParameters import add_paths [as 别名]
def test_validate_streaming_paths_download(self):
paths = ['s3://bucket/key', '-']
cmd_params = CommandParameters('cp', {}, '')
cmd_params.add_paths(paths)
self.assertTrue(cmd_params.parameters['is_stream'])
self.assertTrue(cmd_params.parameters['only_show_errors'])
self.assertFalse(cmd_params.parameters['dir_op'])
示例3: test_validate_sse_c_args_wrong_path_type
# 需要导入模块: from awscli.customizations.s3.subcommands import CommandParameters [as 别名]
# 或者: from awscli.customizations.s3.subcommands.CommandParameters import add_paths [as 别名]
def test_validate_sse_c_args_wrong_path_type(self):
paths = ['s3://bucket/foo', self.file_creator.rootdir]
params = {'dir_op': False, 'sse_c_copy_source': 'AES256',
'sse_c_copy_source_key': 'foo'}
cmd_param = CommandParameters('cp', params, '')
with self.assertRaisesRegexp(ValueError,
'only supported for copy operations'):
cmd_param.add_paths(paths)
示例4: test_add_path_for_non_existsent_local_path_download
# 需要导入模块: from awscli.customizations.s3.subcommands import CommandParameters [as 别名]
# 或者: from awscli.customizations.s3.subcommands.CommandParameters import add_paths [as 别名]
def test_add_path_for_non_existsent_local_path_download(self):
non_existent_path = os.path.join(self.file_creator.rootdir, 'foo')
paths = ['s3://bucket', non_existent_path]
cmd_param = CommandParameters('cp', {'dir_op': True}, '')
cmd_param.add_paths(paths)
self.assertTrue(os.path.exists(non_existent_path))
示例5: test_validate_non_existent_local_path_upload
# 需要导入模块: from awscli.customizations.s3.subcommands import CommandParameters [as 别名]
# 或者: from awscli.customizations.s3.subcommands.CommandParameters import add_paths [as 别名]
def test_validate_non_existent_local_path_upload(self):
non_existent_path = os.path.join(self.file_creator.rootdir, 'foo')
paths = [non_existent_path, 's3://bucket/']
cmd_param = CommandParameters('cp', {}, '')
with self.assertRaises(RuntimeError):
cmd_param.add_paths(paths)
示例6: test_validate_no_streaming_paths
# 需要导入模块: from awscli.customizations.s3.subcommands import CommandParameters [as 别名]
# 或者: from awscli.customizations.s3.subcommands.CommandParameters import add_paths [as 别名]
def test_validate_no_streaming_paths(self):
paths = [self.file_creator.rootdir, 's3://bucket']
cmd_params = CommandParameters('cp', {}, '')
cmd_params.add_paths(paths)
self.assertFalse(cmd_params.parameters['is_stream'])