mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
os.environ is an `environ` object, not a dict. by only interacting with it through builtin functions we can ensure it remains properly accessible to third party libraries which might interact with it in different ways. See https://github.com/alphagov/notifications-api/commit/d2441466 for more detail
18 lines
457 B
Python
18 lines
457 B
Python
import os
|
|
|
|
import pytest
|
|
|
|
from app.cloudfoundry_config import extract_cloudfoundry_config
|
|
|
|
|
|
@pytest.fixture
|
|
def cloudfoundry_environ(os_environ):
|
|
os.environ['VCAP_APPLICATION'] = '{"space_name":"🚀🌌"}'
|
|
|
|
|
|
def test_extract_cloudfoundry_config_populates_other_vars(cloudfoundry_environ):
|
|
extract_cloudfoundry_config()
|
|
|
|
assert os.environ['NOTIFY_ENVIRONMENT'] == '🚀🌌'
|
|
assert os.environ['NOTIFY_LOG_PATH'] == '/home/vcap/logs/app.log'
|