• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python s3.make_loc_files函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tests.unit.customizations.s3.make_loc_files函数的典型用法代码示例。如果您正苦于以下问题:Python make_loc_files函数的具体用法?Python make_loc_files怎么用?Python make_loc_files使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了make_loc_files函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setUp

 def setUp(self):
     super(S3HandlerTestDeleteList, self).setUp()
     self.session = FakeSession()
     params = {'region': 'us-east-1'}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.loc_files = make_loc_files()
开发者ID:50onRed,项目名称:aws-cli,代码行数:7,代码来源:test_s3handler.py


示例2: setUp

 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     self.loc_files = make_loc_files()
     self.bucket = make_s3_files(self.session)
     parser = argparse.ArgumentParser()
     parser.add_argument('--region')
     self.parsed_globals = parser.parse_args(['--region', 'us-east-1'])
开发者ID:2mind,项目名称:aws-cli,代码行数:7,代码来源:test_s3.py


示例3: setUp

 def setUp(self):
     self.local_file = os.path.abspath('.') + os.sep + 'some_directory' \
         + os.sep + 'text1.txt'
     self.local_dir = os.path.abspath('.') + os.sep + 'some_directory' \
         + os.sep
     self.session = FakeSession()
     self.files = make_loc_files()
开发者ID:2mind,项目名称:aws-cli,代码行数:7,代码来源:test_filegenerator.py


示例4: setUp

 def setUp(self):
     self.local_file = os.path.abspath(".") + os.sep + "some_directory" + os.sep + "text1.txt"
     self.local_dir = os.path.abspath(".") + os.sep + "some_directory" + os.sep
     self.session = FakeSession()
     self.service = self.session.get_service("s3")
     self.endpoint = self.service.get_endpoint("us-east-1")
     self.files = make_loc_files()
开发者ID:CitizenB,项目名称:aws-cli,代码行数:7,代码来源:test_filegenerator.py


示例5: setUp

 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     self.service = self.session.get_service("s3")
     self.endpoint = self.service.get_endpoint("us-east-1")
     params = {"region": "us-east-1"}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.loc_files = make_loc_files()
开发者ID:viglesiasce,项目名称:aws-cli,代码行数:8,代码来源:test_s3handler.py


示例6: setUp

 def setUp(self):
     super(CommandArchitectureTest, self).setUp()
     self.session = FakeSession()
     self.bucket = make_s3_files(self.session)
     self.loc_files = make_loc_files()
     self.output = StringIO()
     self.saved_stdout = sys.stdout
     sys.stdout = self.output
开发者ID:Gimpson,项目名称:aws-cli,代码行数:8,代码来源:test_s3.py


示例7: setUp

 def setUp(self):
     super(S3HandlerTestDelete, self).setUp()
     params = {'region': 'us-east-1'}
     self.s3_handler = S3Handler(self.session, params,
                                 runtime_config=runtime_config(
                                     max_concurrent_requests=1))
     self.loc_files = make_loc_files(self.file_creator)
     self.bucket = 'mybucket'
开发者ID:Frame02,项目名称:aws-cli,代码行数:8,代码来源:test_s3handler.py


示例8: setUp

 def setUp(self):
     self.environ = {}
     self.environ_patch = patch('os.environ', self.environ)
     self.environ_patch.start()
     self.mock = MagicMock()
     self.mock.get_config = MagicMock(return_value={'region': None})
     self.loc_files = make_loc_files()
     self.bucket = 's3testbucket'
开发者ID:hardiku,项目名称:aws-cli,代码行数:8,代码来源:test_subcommands.py


示例9: setUp

 def setUp(self):
     super(S3HandlerTestDeleteList, self).setUp()
     self.session = FakeSession()
     self.service = self.session.get_service('s3')
     self.endpoint = self.service.get_endpoint('us-east-1')
     params = {'region': 'us-east-1'}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.loc_files = make_loc_files()
开发者ID:SydOps,项目名称:aws-cli,代码行数:9,代码来源:test_s3handler.py


示例10: setUp

 def setUp(self):
     self.local_file = six.text_type(os.path.abspath('.') + os.sep + 'some_directory' \
         + os.sep + 'text1.txt')
     self.local_dir = six.text_type(os.path.abspath('.') + os.sep + 'some_directory' \
         + os.sep)
     self.session = FakeSession()
     self.service = self.session.get_service('s3')
     self.endpoint = self.service.get_endpoint('us-east-1')
     self.files = make_loc_files()
开发者ID:HackedByChinese,项目名称:aws-cli,代码行数:9,代码来源:test_filegenerator.py


示例11: setUp

 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     self.client = self.session.create_client('s3', 'us-west-2')
     self.source_client = self.session.create_client('s3', 'us-west-2')
     params = {'region': 'us-west-2'}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.file_creator = FileCreator()
     self.loc_files = make_loc_files(self.file_creator)
开发者ID:Frame02,项目名称:aws-cli,代码行数:9,代码来源:test_s3handler.py


示例12: setUp

 def setUp(self):
     self.environ = {}
     self.environ_patch = patch("os.environ", self.environ)
     self.environ_patch.start()
     self.session = FakeSession()
     self.mock = MagicMock()
     self.mock.get_config = MagicMock(return_value={"region": None})
     self.loc_files = make_loc_files()
     self.bucket = make_s3_files(self.session)
开发者ID:nealma,项目名称:aws-cli,代码行数:9,代码来源:test_s3.py


示例13: setUp

 def setUp(self):
     super(CommandArchitectureTest, self).setUp()
     self.session = self.driver.session
     self.bucket = 'mybucket'
     self.file_creator = FileCreator()
     self.loc_files = make_loc_files(self.file_creator)
     self.output = StringIO()
     self.err_output = StringIO()
     self.saved_stdout = sys.stdout
     self.saved_stderr = sys.stderr
     sys.stdout = self.output
     sys.stderr = self.err_output
开发者ID:MAS150MD200,项目名称:aws-cli,代码行数:12,代码来源:test_subcommands.py


示例14: setUp

 def setUp(self):
     super(S3HandlerExceptionMultiTaskTest, self).setUp()
     self.session = FakeSession(True, True)
     self.service = self.session.get_service('s3')
     self.endpoint = self.service.get_endpoint('us-east-1')
     params = {'region': 'us-east-1', 'quiet': True}
     self.s3_handler_multi = S3Handler(
         self.session, params,
         runtime_config=runtime_config(
             multipart_threshold=10, multipart_chunksize=2))
     self.bucket = create_bucket(self.session)
     self.loc_files = make_loc_files()
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
开发者ID:hardiku,项目名称:aws-cli,代码行数:14,代码来源:test_s3handler.py


示例15: setUp

 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     params = {'region': 'us-east-1', 'acl': ['private']}
     self.s3_handler = S3Handler(self.session, params)
     self.s3_handler_multi = S3Handler(self.session, multi_threshold=10,
                                       chunksize=2,
                                       params=params)
     self.bucket = create_bucket(self.session)
     self.loc_files = make_loc_files()
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     self.output = StringIO()
     self.saved_stdout = sys.stdout
     sys.stdout = self.output
开发者ID:2mind,项目名称:aws-cli,代码行数:14,代码来源:test_s3handler.py


示例16: setUp

 def setUp(self):
     super(S3HandlerTestUpload, self).setUp()
     params = {'region': 'us-east-1', 'acl': 'private', 'quiet': True}
     self.s3_handler = S3Handler(
         self.session, params, runtime_config=runtime_config(
             max_concurrent_requests=1))
     self.s3_handler_multi = S3Handler(
         self.session, params=params,
         runtime_config=runtime_config(
             multipart_threshold=10, multipart_chunksize=10,
             max_concurrent_requests=1))
     self.bucket = 'mybucket'
     self.loc_files = make_loc_files(self.file_creator)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
开发者ID:Lumida,项目名称:aws-cli,代码行数:15,代码来源:test_s3handler.py


示例17: test_upload

 def test_upload(self):
     self.loc_files = make_loc_files(self.file_creator)
     # Confirm there are no objects in the bucket.
     response = self.client.list_objects(Bucket=self.bucket)
     self.assertEqual(len(response.get('Contents', [])), 0)
     # Create file info objects to perform upload.
     files = [self.loc_files[0], self.loc_files[1]]
     tasks = []
     for i in range(len(files)):
         tasks.append(FileInfo(
             src=self.loc_files[i],
             dest=self.s3_files[i],
             operation_name='upload', size=0,
             client=self.client,
         ))
     # Perform the upload.
     self.s3_handler.call(tasks)
     # Confirm the files were uploaded.
     response = self.client.list_objects(Bucket=self.bucket)
     self.assertEqual(len(response.get('Contents', [])), 2)
开发者ID:Athena88,项目名称:aws-cli,代码行数:20,代码来源:test_s3handler.py


示例18: test_multi_upload

    def test_multi_upload(self):
        self.loc_files = make_loc_files(self.file_creator, self.threshold+1)
        files = [self.loc_files[0], self.loc_files[1]]
        tasks = []
        for i in range(len(files)):
            tasks.append(FileInfo(
                src=self.loc_files[i],
                dest=self.s3_files[i],
                size=self.threshold+1,
                operation_name='upload',
                client=self.client,
            ))

        self.s3_handler_multi.call(tasks)

        # Confirm UploadPart was called
        self.assertIn("Completed 4 of 4 part(s)", self.output.getvalue())

        # Confirm the files were uploaded.
        response = self.client.list_objects(Bucket=self.bucket)
        self.assertEqual(len(response.get('Contents', [])), 2)
开发者ID:Athena88,项目名称:aws-cli,代码行数:21,代码来源:test_s3handler.py


示例19: setUp

 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     params = {'region': 'us-east-1'}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session, key1='a+b/foo', key2=None)
     self.loc_files = make_loc_files()
开发者ID:TarantulaTechnology,项目名称:aws,代码行数:6,代码来源:test_s3handler.py


示例20: setUp

 def setUp(self):
     self.client = None
     self.file_creator = FileCreator()
     self.files = make_loc_files(self.file_creator)
     self.local_file = self.files[0]
     self.local_dir = self.files[3] + os.sep
开发者ID:mtdowling,项目名称:aws-cli,代码行数:6,代码来源:test_filegenerator.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python s3.make_s3_files函数代码示例发布时间:2022-05-27
下一篇:
Python s3.list_contents函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap