def test_load(): environ['ENV123'] = 'xx' environ['ENV456'] = 'yy' ss = SecretsStore.from_dict(spec) assert ss.get('ENV123') == 'xx', 'failed on 1st env var secret' assert ss.get('ENV456') == 'yy', 'failed on 1st env var secret' assert ss.get('MYENV') == '123', 'failed on 1st env var secret' assert ss.get('MY2NDENV') == '456', 'failed on 1st env var secret' assert ss.get('abc') == 'def', 'failed on 1st env var secret' print(ss.get_all())
def test_inline_str(): spec = { 'secret_sources': [ { 'kind': 'inline', 'source': "{'abc': 'def'}" }, ], } ss = SecretsStore.from_dict(spec) assert ss.get('abc') == 'def', 'failed on 1st env var secret'