Files
notifications-admin/tests/app/test_cloudfoundry_config.py
2022-08-05 00:25:03 -07:00

25 lines
519 B
Python

import json
import os
import pytest
from app.cloudfoundry_config import extract_cloudfoundry_config
@pytest.fixture
def vcap_services():
return {
'aws-elasticache-redis': [{
'credentials': {
'uri': 'redis uri'
}
}],
}
def test_extract_cloudfoundry_config_populates_other_vars(os_environ, vcap_services):
os.environ['VCAP_SERVICES'] = json.dumps(vcap_services)
extract_cloudfoundry_config()
assert os.environ['REDIS_URL'] == 'redis uri'