test_renderers.py 995 B

1234567891011121314151617181920212223242526272829303132
  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. class TestJinjaRenderer(ModuleCase):
  10. '''
  11. Validate that ordering works correctly
  12. '''
  13. def test_dot_notation(self):
  14. '''
  15. Test the Jinja dot-notation syntax for calling execution modules
  16. '''
  17. ret = self.run_function('state.sls', ['jinja_dot_notation'])
  18. for state_ret in ret.values():
  19. self.assertTrue(state_ret['result'])
  20. def test_salt_contains_function(self):
  21. '''
  22. Test if we are able to check if a function exists inside the "salt"
  23. wrapper (AliasLoader) which is available on Jinja templates.
  24. '''
  25. ret = self.run_function('state.sls', ['jinja_salt_contains_function'])
  26. for state_ret in ret.values():
  27. self.assertTrue(state_ret['result'])