Files
notifications-admin/tests/app/test_cloudfoundry_config.py
Ben Thorner 4a3ba97115 Remove redundant conditional for CF Redis
This is now used in all environments and we've removed support for
non-CF Redis [1].

[1]: https://github.com/alphagov/notifications-admin/pull/4213
2022-04-20 11:32:57 +01:00

25 lines
503 B
Python

import json
import os
import pytest
from app.cloudfoundry_config import extract_cloudfoundry_config
@pytest.fixture
def vcap_services():
return {
'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'