def test_render_charm_config(): charm_config = io.StringIO( textwrap.dedent(""" options: test: default: charm default type: string """)) output = reify.render(TEMPLATE, {}, None, {}, charm_config) assert output == "'charm default' ''\n"
def test_render_ctx_overrides_envfile(): output = reify.render(TEMPLATE, {'env': { 'TEST': 'ctx' }}, io.StringIO('TEST=envfile'), {}) assert output == "'' 'ctx'\n"
def test_render_envfile_overrides_env(): output = reify.render(TEMPLATE, {}, io.StringIO('TEST=envfile'), {'TEST': 'env'}) assert output == "'' 'envfile'\n"
def test_render_envfile(): output = reify.render(TEMPLATE, {}, io.StringIO('TEST=envfile'), {}) assert output == "'' 'envfile'\n"
def test_render_envvar(): output = reify.render(TEMPLATE, {}, None, {'TEST': 'env'}) assert output == "'' 'env'\n"
def test_render_simple(): output = reify.render(TEMPLATE, {'test': 'ctx'}, None, {}) assert output == "'ctx' ''\n"
def test_render_none(): output = reify.render(TEMPLATE, {}, None, {}) assert output == "'' ''\n"