Merge pull request #878 from alphagov/fix-config

Can't set environs to nonetype
This commit is contained in:
Leo Hemsted
2017-03-31 17:25:36 +01:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ def extract_notify_config(notify_config):
os.environ['ADMIN_CLIENT_SECRET'] = notify_config['credentials']['admin_client_secret']
os.environ['SECRET_KEY'] = notify_config['credentials']['secret_key']
os.environ['DANGEROUS_SALT'] = notify_config['credentials']['dangerous_salt']
os.environ['PERFORMANCE_PLATFORM_TOKEN'] = notify_config['credentials'].get('performance_platform_token')
os.environ['PERFORMANCE_PLATFORM_TOKEN'] = notify_config['credentials'].get('performance_platform_token', '')
def extract_notify_aws_config(aws_config):

View File

@@ -150,6 +150,15 @@ def test_notify_config():
assert os.environ['PERFORMANCE_PLATFORM_TOKEN'] == 'performance platform token'
@pytest.mark.usefixtures('os_environ', 'cloudfoundry_environ')
def test_notify_config_if_perf_platform_not_set(cloudfoundry_config):
del cloudfoundry_config['user-provided'][0]['credentials']['performance_platform_token']
set_config_env_vars(cloudfoundry_config)
assert os.environ['PERFORMANCE_PLATFORM_TOKEN'] == ''
@pytest.mark.usefixtures('os_environ', 'cloudfoundry_environ')
def test_aws_config():
extract_cloudfoundry_config()