def test_conf(conf, tmpdir):
    """A written-out config file for encrypt/decrypt testing"""
    # switch the conf dir over to the tmpdir, set the encryption key
    conf._yaycl.config_dir = tmpdir.strpath
    conf._yaycl.crypt_key = TEST_KEY
    conf.runtime['test'] = {'test_key': 'test value'}
    conf.save('test')
    # del the test key to ensure a load when conf.test is accessed
    del(conf['test'])
    return yaycl_crypt._yamls(conf.file_path('test'))
def test_conf(conf, tmpdir):
    """A written-out config file for encrypt/decrypt testing"""
    # switch the conf dir over to the tmpdir, set the encryption key
    conf._yaycl.config_dir = tmpdir.strpath
    conf._yaycl.crypt_key = TEST_KEY
    conf.runtime['test'] = {'test_key': 'test value'}
    conf.save('test')
    # del the test key to ensure a load when conf.test is accessed
    del (conf['test'])
    return yaycl_crypt._yamls(conf.file_path('test'))
def test_yaml_noextension_parse():
    # given a filename with no extension, we look for an encrypted version with a '.e' extension
    yamls = yaycl_crypt._yamls('no_extension')
    encrypted_extension = os.path.splitext(yamls.encrypted)[1]
    assert encrypted_extension == '.e'
def test_yaml_noextension_parse():
    # given a filename with no extension, we look for an encrypted version with a '.e' extension
    yamls = yaycl_crypt._yamls('no_extension')
    encrypted_extension = os.path.splitext(yamls.encrypted)[1]
    assert encrypted_extension == '.e'