Exemplo n.º 1
0
from django.conf import settings

from wristband.providers.config import ProvidersConfig

if settings.PROVIDER_CONFIG == 'providers.yaml':
    providers_config = ProvidersConfig.load_from_file(settings.PROVIDER_CONFIG)
else:
    providers_config = ProvidersConfig.load_from_env(settings.PROVIDER_CONFIG)
Exemplo n.º 2
0
def test_providers_config_invalid_yaml():
    with pytest.raises(ImproperlyConfigured):
        ProvidersConfig.load_from_env('%YAML')