1
0
secret_loader/test/test_init.py
Jon Michael Aanes 2b1d4366d4
All checks were successful
Test Python / Test (push) Successful in 23s
Configure secrets folder
2024-09-04 19:37:06 +02:00

18 lines
495 B
Python

import secret_loader
def test_hardcoded():
loader = secret_loader.SecretLoader(ENV_KEY_PREFIX='TEST', KEY='VALUE')
assert loader.load('ENV_KEY_PREFIX') == 'TEST'
assert loader.load('KEY') == 'VALUE'
def test_lookup_secrets_dir():
loader = secret_loader.SecretLoader(SECRETS_DIRECTORY='test/example-secrets')
assert loader.load('MY_SECRET') == 'HELLO SECRET'
def test_lookup_unknown():
loader = secret_loader.SecretLoader()
assert loader.load('UNKNOWN') is None