Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
 def setUp(self):
     self.session = FakeSession()
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
     self.service = self.session.get_service('s3')
     self.endpoint = self.service.get_endpoint('us-east-1')
Ejemplo n.º 3
0
 def setUp(self):
     self.session = FakeSession()
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + "/" + "text1.txt"
     self.file2 = self.bucket + "/" + "another_directory/text2.txt"
     self.service = self.session.get_service("s3")
     self.endpoint = self.service.get_endpoint("us-east-1")
Ejemplo n.º 4
0
 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")
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + "/" + "text1.txt"
     self.file2 = self.bucket + "/" + "another_directory/text2.txt"
Ejemplo n.º 5
0
 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'])
Ejemplo n.º 6
0
    def setUp(self):
        super(S3HandlerTestDownload, 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.s3_handler_multi = S3Handler(self.session,
                                          params,
                                          multi_threshold=10,
                                          chunksize=2)
        self.bucket = make_s3_files(self.session)
        self.s3_files = [
            self.bucket + '/text1.txt',
            self.bucket + '/another_directory/text2.txt'
        ]
        directory1 = os.path.abspath('.') + os.sep + 'some_directory' + os.sep
        filename1 = directory1 + "text1.txt"
        directory2 = directory1 + 'another_directory' + os.sep
        filename2 = directory2 + "text2.txt"
        self.loc_files = [filename1, filename2]

        self.fail_session = FakeSession(connection_error=True)
        self.fail_session.s3 = self.session.s3
        self.s3_handler_multi_except = S3Handler(self.fail_session,
                                                 params,
                                                 multi_threshold=10,
                                                 chunksize=2)
Ejemplo n.º 7
0
 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')
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
Ejemplo n.º 8
0
 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'])
Ejemplo n.º 9
0
 def setUp(self):
     self.session = FakeSession()
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
     self.service = self.session.get_service('s3')
     self.endpoint = self.service.get_endpoint('us-east-1')
Ejemplo n.º 10
0
    def setUp(self):
        super(S3HandlerTestDownload, 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.s3_handler_multi = S3Handler(
            self.session, params,
            runtime_config=runtime_config(multipart_threshold=10,
                                          multipart_chunksize=2))
        self.bucket = make_s3_files(self.session)
        self.s3_files = [self.bucket + '/text1.txt',
                         self.bucket + '/another_directory/text2.txt']
        directory1 = os.path.abspath('.') + os.sep + 'some_directory' + os.sep
        filename1 = directory1 + "text1.txt"
        directory2 = directory1 + 'another_directory' + os.sep
        filename2 = directory2 + "text2.txt"
        self.loc_files = [filename1, filename2]

        self.fail_session = FakeSession(connection_error=True)
        self.fail_session.s3 = self.session.s3
        self.s3_handler_multi_except = S3Handler(
            self.fail_session, params,
            runtime_config=runtime_config(
                multipart_threshold=10,
                multipart_chunksize=2))
Ejemplo n.º 11
0
 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()
Ejemplo n.º 12
0
 def setUp(self):
     super(S3HandlerTestURLEncodeDeletes, 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, key1='a+b/foo', key2=None)
Ejemplo n.º 13
0
 def setUp(self):
     super(S3HandlerTestURLEncodeDeletes, 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, key1='a+b/foo', key2=None)
Ejemplo n.º 14
0
 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()
Ejemplo n.º 15
0
 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()
Ejemplo n.º 16
0
 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()
Ejemplo n.º 17
0
 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
Ejemplo n.º 18
0
 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.bucket = make_s3_files(self.session, key1=u'\u2713')
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + '/' + u'\u2713']
     self.s3_files2 = [self.bucket2 + '/' + u'\u2713']
Ejemplo n.º 19
0
 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
Ejemplo n.º 20
0
 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)
Ejemplo n.º 21
0
 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)
Ejemplo n.º 22
0
 def test_move_unicode(self):
     self.bucket2 = make_s3_files(self.session, key1=u'\u2713')
     tasks = [FileInfo(src=self.bucket2 + '/' + u'\u2713',
                       src_type='s3',
                       dest=self.bucket + '/' + u'\u2713',
                       dest_type='s3', operation='move',
                       size=0)]
     self.s3_handler.call(tasks)
     self.assertEqual(len(list_contents(self.bucket, self.session)), 1)
Ejemplo n.º 23
0
 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()
Ejemplo n.º 24
0
 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()
Ejemplo n.º 25
0
 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.bucket = make_s3_files(self.session)
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     self.s3_files2 = [self.bucket2 + '/text1.txt',
                       self.bucket2 + '/another_directory/text2.txt']
Ejemplo n.º 26
0
 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", "acl": ["private"]}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + "/text1.txt", self.bucket + "/another_directory/text2.txt"]
     self.s3_files2 = [self.bucket2 + "/text1.txt", self.bucket2 + "/another_directory/text2.txt"]
Ejemplo n.º 27
0
 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', 'acl': ['private'], 'quiet': True}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session, key1=u'\u2713')
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + '/' + u'\u2713']
     self.s3_files2 = [self.bucket2 + '/' + u'\u2713']
Ejemplo n.º 28
0
 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", "acl": ["private"]}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session, key1=u"\u2713")
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + "/" + u"\u2713"]
     self.s3_files2 = [self.bucket2 + "/" + u"\u2713"]
Ejemplo n.º 29
0
 def setUp(self):
     super(S3HandlerTestMvS3S3, self).setUp()
     self.session = FakeSession()
     params = {'region': 'us-east-1', 'acl': ['private']}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     self.s3_files2 = [self.bucket2 + '/text1.txt',
                       self.bucket2 + '/another_directory/text2.txt']
Ejemplo n.º 30
0
 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     # Use the datetime and and blob parsing of the CLI
     factory = self.session.get_component('response_parser_factory')
     factory.set_parser_defaults(blob_parser=lambda x: x,
                                 timestamp_parser=lambda x: x)
     self.service = self.session.get_service('s3')
     self.endpoint = self.service.get_endpoint('us-east-1')
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
Ejemplo n.º 31
0
 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     # Use the datetime and and blob parsing of the CLI
     factory = self.session.get_component('response_parser_factory')
     factory.set_parser_defaults(
         blob_parser=lambda x: x,
         timestamp_parser=lambda x: x)
     self.service = self.session.get_service('s3')
     self.endpoint = self.service.get_endpoint('us-east-1')
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
Ejemplo n.º 32
0
 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', 'acl': ['private']}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     self.s3_files2 = [self.bucket2 + '/text1.txt',
                       self.bucket2 + '/another_directory/text2.txt']
Ejemplo n.º 33
0
 def setUp(self):
     super(S3HandlerTestMvS3Local, 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.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     directory1 = os.path.abspath('.') + os.sep + 'some_directory' + os.sep
     filename1 = directory1 + "text1.txt"
     directory2 = directory1 + 'another_directory' + os.sep
     filename2 = directory2 + "text2.txt"
     self.loc_files = [filename1, filename2]
Ejemplo n.º 34
0
 def setUp(self):
     super(S3HandlerTestMvS3S3, 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', 'acl': ['private']}
     self.s3_handler = S3Handler(self.session, params)
     self.bucket = make_s3_files(self.session)
     self.bucket2 = create_bucket(self.session)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     self.s3_files2 = [self.bucket2 + '/text1.txt',
                       self.bucket2 + '/another_directory/text2.txt']
Ejemplo n.º 35
0
 def test_move_unicode(self):
     self.bucket2 = make_s3_files(self.session, key1=u'\u2713')
     tasks = [FileInfo(
         src=self.bucket2 + '/' + u'\u2713',
         src_type='s3',
         dest=self.bucket + '/' + u'\u2713',
         dest_type='s3', operation_name='move',
         size=0,
         service=self.service,
         endpoint=self.endpoint,
     )]
     self.s3_handler.call(tasks)
     self.assertEqual(len(list_contents(self.bucket, self.session)), 1)
Ejemplo n.º 36
0
 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.s3_handler_multi = S3Handler(self.session, multi_threshold=10, chunksize=2, params=params)
     self.bucket = make_s3_files(self.session)
     self.s3_files = [self.bucket + "/text1.txt", self.bucket + "/another_directory/text2.txt"]
     directory1 = os.path.abspath(".") + os.sep + "some_directory" + os.sep
     filename1 = directory1 + "text1.txt"
     directory2 = directory1 + "another_directory" + os.sep
     filename2 = directory2 + "text2.txt"
     self.loc_files = [filename1, filename2]
Ejemplo n.º 37
0
 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     params = {'region': 'us-east-1'}
     self.s3_handler = S3Handler(self.session, params)
     self.s3_handler_multi = S3Handler(self.session, multi_threshold=10,
                                       chunksize=2, params=params)
     self.bucket = make_s3_files(self.session)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     directory1 = os.path.abspath('.') + os.sep + 'some_directory' + os.sep
     filename1 = directory1 + "text1.txt"
     directory2 = directory1 + 'another_directory' + os.sep
     filename2 = directory2 + "text2.txt"
     self.loc_files = [filename1, filename2]
Ejemplo n.º 38
0
 def setUp(self):
     super(S3HandlerTestMvS3Local, 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.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     directory1 = os.path.abspath('.') + os.sep + 'some_directory' + os.sep
     filename1 = directory1 + "text1.txt"
     directory2 = directory1 + 'another_directory' + os.sep
     filename2 = directory2 + "text2.txt"
     self.loc_files = [filename1, filename2]
Ejemplo n.º 39
0
 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.s3_handler_multi = S3Handler(self.session, multi_threshold=10,
                                       chunksize=2, params=params)
     self.bucket = make_s3_files(self.session)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     directory1 = os.path.abspath('.') + os.sep + 'some_directory' + os.sep
     filename1 = directory1 + "text1.txt"
     directory2 = directory1 + 'another_directory' + os.sep
     filename2 = directory2 + "text2.txt"
     self.loc_files = [filename1, filename2]
Ejemplo n.º 40
0
 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.s3_handler_multi = S3Handler(
         self.session, params,
         runtime_config=runtime_config(multipart_threshold=10,
                                       multipart_chunksize=2))
     self.bucket = make_s3_files(self.session)
     self.s3_files = [self.bucket + '/text1.txt',
                      self.bucket + '/another_directory/text2.txt']
     directory1 = os.path.abspath('.') + os.sep + 'some_directory' + os.sep
     filename1 = directory1 + "text1.txt"
     directory2 = directory1 + 'another_directory' + os.sep
     filename2 = directory2 + "text2.txt"
     self.loc_files = [filename1, filename2]
Ejemplo n.º 41
0
 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
Ejemplo n.º 42
0
 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()
Ejemplo n.º 43
0
 def setUp(self):
     self.session = FakeSession()
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
Ejemplo n.º 44
0
 def setUp(self):
     super(S3HandlerTestURLEncodeDeletes, self).setUp()
     self.session = FakeSession()
     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)
Ejemplo n.º 45
0
 def setUp(self):
     self.session = FakeSession()
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'
Ejemplo n.º 46
0
 def setUp(self):
     self.session = botocore.session.get_session(EnvironmentVariables)
     self.bucket = make_s3_files(self.session)
     self.file1 = self.bucket + '/' + 'text1.txt'
     self.file2 = self.bucket + '/' + 'another_directory/text2.txt'