Files
notifications-admin/tests/app/test_cloudfoundry_config.py

19 lines
508 B
Python
Raw Normal View History

2016-12-08 16:50:37 +00:00
import os
import pytest
from app.cloudfoundry_config import extract_cloudfoundry_config
2016-12-08 16:50:37 +00:00
@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'