def test_apply_template_on_contents(self):
        contents = 'This is a {{ template }}.'
        defaults = {'template': 'templated file'}
        ret = filemod.apply_template_on_contents(
            contents,
            template='jinja',
            context={'opts': filemod.__opts__},
            defaults=defaults,
            saltenv='base')
        self.assertEqual(ret, 'This is a templated file.')
Tests that the templating engine works on string contents
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/file_test.py/FileModuleTestCase.test_apply_template_on_contents