cat ~/.aws/config
[default]
request_checksum_calculation = WHEN_REQUIRED
response_checksum_validation = WHEN_REQUIRED
Change-Id: I27842b255e0c154d0cbacf9c4e240b8852fddcff
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
for filename in files:
zfile.write(os.path.join(root, filename))
b3resource = boto3.resource(
for filename in files:
zfile.write(os.path.join(root, filename))
b3resource = boto3.resource(
- 's3', endpoint_url=os.environ["S3_ENDPOINT_URL"],
- config=botocore.config.Config(
- request_checksum_calculation="when_required",
- response_checksum_validation="when_required"))
+ 's3', endpoint_url=os.environ["S3_ENDPOINT_URL"])
dst_s3_url = os.environ["S3_DST_URL"]
multipart_threshold = 5 * 1024 ** 5 if "google" in os.environ[
"S3_ENDPOINT_URL"] else 8 * 1024 * 1024
dst_s3_url = os.environ["S3_DST_URL"]
multipart_threshold = 5 * 1024 ** 5 if "google" in os.environ[
"S3_ENDPOINT_URL"] else 8 * 1024 * 1024
"""
try:
b3resource = boto3.resource(
"""
try:
b3resource = boto3.resource(
- 's3', endpoint_url=os.environ["S3_ENDPOINT_URL"],
- config=botocore.config.Config(
- request_checksum_calculation="when_required",
- response_checksum_validation="when_required"))
+ 's3', endpoint_url=os.environ["S3_ENDPOINT_URL"])
dst_s3_url = os.environ["S3_DST_URL"]
multipart_threshold = 5 * 1024 ** 5 if "google" in os.environ[
"S3_ENDPOINT_URL"] else 8 * 1024 * 1024
dst_s3_url = os.environ["S3_DST_URL"]
multipart_threshold = 5 * 1024 ** 5 if "google" in os.environ[
"S3_ENDPOINT_URL"] else 8 * 1024 * 1024
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY)
+ 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'])
@mock.patch('boto3.resource', side_effect=Exception)
def test_publish_artifacts_exc3(self, *args):
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
@mock.patch('boto3.resource', side_effect=Exception)
def test_publish_artifacts_exc3(self, *args):
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY)
+ 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'])
@mock.patch('boto3.resource')
def test_publish_artifacts_exc4(self, *args):
@mock.patch('boto3.resource')
def test_publish_artifacts_exc4(self, *args):
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY)
+ 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'])
@mock.patch('boto3.resource')
def test_publish_artifacts_exc5(self, *args):
@mock.patch('boto3.resource')
def test_publish_artifacts_exc5(self, *args):
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
self.assertEqual(self.test.publish_artifacts(),
testcase.TestCase.EX_PUBLISH_ARTIFACTS_ERROR)
args[0].assert_called_once_with(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY)
+ 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'])
@mock.patch('mimetypes.guess_type', return_value=(None, None))
@mock.patch('boto3.resource')
@mock.patch('mimetypes.guess_type', return_value=(None, None))
@mock.patch('boto3.resource')
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
args[1].assert_called_once_with(
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
args[1].assert_called_once_with(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY)
+ 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'])
@mock.patch('mimetypes.guess_type', return_value=(None, None))
@mock.patch('boto3.resource')
@mock.patch('mimetypes.guess_type', return_value=(None, None))
@mock.patch('boto3.resource')
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
args[1].assert_called_once_with(
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
args[1].assert_called_once_with(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY)
+ 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'])
@mock.patch('mimetypes.guess_type', return_value=(None, None))
@mock.patch('os.path.exists', return_value=True)
@mock.patch('mimetypes.guess_type', return_value=(None, None))
@mock.patch('os.path.exists', return_value=True)
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
expected = [
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
expected = [
- mock.call(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY),
+ mock.call('s3', endpoint_url=os.environ['S3_ENDPOINT_URL']),
mock.call().meta.client.head_bucket(Bucket='xtesting'),
mock.call().Bucket('xtesting'),
mock.call().Bucket().upload_file(
mock.call().meta.client.head_bucket(Bucket='xtesting'),
mock.call().Bucket('xtesting'),
mock.call().Bucket().upload_file(
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
expected = [
testcase.TestCase.EX_OK)
args[0].assert_called_once_with(self.test.res_dir)
expected = [
- mock.call(
- 's3', endpoint_url=os.environ['S3_ENDPOINT_URL'],
- config=mock.ANY),
+ mock.call('s3', endpoint_url=os.environ['S3_ENDPOINT_URL']),
mock.call().meta.client.head_bucket(Bucket='xtesting'),
mock.call().Bucket('xtesting'),
mock.call().Bucket().upload_file(
mock.call().meta.client.head_bucket(Bucket='xtesting'),
mock.call().Bucket('xtesting'),
mock.call().Bucket().upload_file(