test_renderers.py 995 B

1234567891011121314151617181920212223242526272829303132333435
  1. """
  2. Integration tests for renderer functions
  3. """
  4. import pytest
  5. from tests.support.case import ModuleCase
  6. from tests.support.helpers import flaky, slowTest
  7. @pytest.mark.windows_whitelisted
  8. class TestJinjaRenderer(ModuleCase):
  9. """
  10. Validate that ordering works correctly
  11. """
  12. @slowTest
  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. @flaky
  21. @slowTest
  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"])