2
0
mirror of https://github.com/cmehay/pyentrypoint synced 2024-10-30 15:21:11 +00:00
pyentrypoint/tests/secret_test.py
2017-06-12 21:05:57 +02:00

29 lines
730 B
Python

# Tests using pytest
from __future__ import absolute_import
from __future__ import unicode_literals
import pytest
from yaml import load
from yaml import Loader
from pyentrypoint import Entrypoint
@pytest.mark.v3
def test_secret_templates():
test_confs = ['configs/secret.yml']
for test_conf in test_confs:
entry = Entrypoint(conf='configs/secret.yml')
conf = entry.config
entry.apply_conf()
for _, config_file in conf.get_templates():
with open(config_file, mode='r') as r:
test = load(stream=r, Loader=Loader)
# test secrets
assert test['SECRET']['secret1'] == 'SECRET1'
assert test['SECRET']['secret2'] == 'SECRET2'