def test_apply_template_on_contents(self): ''' Tests that the templating engine works on string contents ''' 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.')
def test_apply_template_on_contents(self): ''' Tests that the templating engine works on string contents ''' contents = 'This is a {{ template }}.' defaults = {'template': 'templated file'} with patch.object(SaltCacheLoader, 'file_client', Mock()): 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.')
def test_apply_template_on_contents(): """ Tests that the templating engine works on string contents """ contents = "This is a {{ template }}." defaults = {"template": "templated file"} with patch.object(SaltCacheLoader, "file_client", Mock()): ret = filemod.apply_template_on_contents( contents, template="jinja", context={"opts": filemod.__opts__}, defaults=defaults, saltenv="base", ) assert ret == "This is a templated file."