Files
notifications-admin/tests/app/test_cloudfoundry_config.py
Alexey Bezhan 8346e1b8be Remove VCAP_SERVICES parsing code
We're no longer using user-provided services for application secrets
so we can remove the cloudfoundry_config code responsible for parsing
VCAP_SERVICES.
2018-01-09 14:18:32 +00:00

19 lines
508 B
Python

import os
import pytest
from app.cloudfoundry_config import extract_cloudfoundry_config
@pytest.fixture
def cloudfoundry_environ(monkeypatch):
monkeypatch.setenv('VCAP_APPLICATION', '{"space_name":"🚀🌌"}')
@pytest.mark.usefixtures('os_environ', 'cloudfoundry_environ')
def test_extract_cloudfoundry_config_populates_other_vars():
extract_cloudfoundry_config()
assert os.environ['NOTIFY_ENVIRONMENT'] == '🚀🌌'
assert os.environ['NOTIFY_LOG_PATH'] == '/home/vcap/logs/app.log'