当前位置: 首页>>代码示例>>Python>>正文


Python CommandParameters.add_paths方法代码示例

本文整理汇总了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)
开发者ID:MAS150MD200,项目名称:aws-cli,代码行数:9,代码来源:test_subcommands.py

示例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'])
开发者ID:MAS150MD200,项目名称:aws-cli,代码行数:9,代码来源:test_subcommands.py

示例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)
开发者ID:MAS150MD200,项目名称:aws-cli,代码行数:10,代码来源:test_subcommands.py

示例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))
开发者ID:MAS150MD200,项目名称:aws-cli,代码行数:8,代码来源:test_subcommands.py

示例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)
开发者ID:MAS150MD200,项目名称:aws-cli,代码行数:8,代码来源:test_subcommands.py

示例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'])
开发者ID:MAS150MD200,项目名称:aws-cli,代码行数:7,代码来源:test_subcommands.py


注:本文中的awscli.customizations.s3.subcommands.CommandParameters.add_paths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。