Connect to s3 buckets created by notifications-api

This commit is contained in:
Ryan Ahearn
2022-09-19 11:19:38 -04:00
parent 442bc39ca0
commit 271cf7643d
6 changed files with 68 additions and 35 deletions

View File

@@ -14,11 +14,28 @@ def vcap_services():
'uri': 'redis://xxx:6379'
}
}],
's3': [
{
'name': 'notifications-api-csv-upload-bucket-test',
'credentials': {
'bucket': 'csv-upload-bucket'
}
},
{
'name': 'notifications-api-contact-list-bucket-test',
'credentials': {
'bucket': 'contact-list-bucket'
}
}
],
}
def test_extract_cloudfoundry_config_populates_other_vars(os_environ, vcap_services):
os.environ['DEPLOY_ENV'] = 'test'
os.environ['VCAP_SERVICES'] = json.dumps(vcap_services)
extract_cloudfoundry_config()
assert os.environ['REDIS_URL'] == 'rediss://xxx:6379'
assert os.environ['CSV_UPLOAD_BUCKET_NAME'] == 'csv-upload-bucket'
assert os.environ['CONTACT_LIST_BUCKET_NAME'] == 'contact-list-bucket'