1
0

test_renderers.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. # coding: utf-8
  2. '''
  3. Integration tests for renderer functions
  4. '''
  5. # Import Python Libs
  6. from __future__ import absolute_import, unicode_literals, print_function
  7. # Import Salt Testing libs
  8. from tests.support.case import ModuleCase
  9. from tests.support.helpers import flaky
  10. class TestJinjaRenderer(ModuleCase):
  11. '''
  12. Validate that ordering works correctly
  13. '''
  14. def test_dot_notation(self):
  15. '''
  16. Test the Jinja dot-notation syntax for calling execution modules
  17. '''
  18. ret = self.run_function('state.sls', ['jinja_dot_notation'])
  19. for state_ret in ret.values():
  20. self.assertTrue(state_ret['result'])
  21. @flaky
  22. def test_salt_contains_function(self):
  23. '''
  24. Test if we are able to check if a function exists inside the "salt"
  25. wrapper (AliasLoader) which is available on Jinja templates.
  26. '''
  27. ret = self.run_function('state.sls', ['jinja_salt_contains_function'])
  28. for state_ret in ret.values():
  29. self.assertTrue(state_ret['result'])