123456789101112131415161718192021222324252627282930313233343536373839404142 |
- # coding: utf-8
- """
- Integration tests for renderer functions
- """
- from __future__ import absolute_import, print_function, unicode_literals
- import pytest
- import salt.utils.platform
- from salt.ext import six
- from tests.support.case import ModuleCase
- from tests.support.unit import skipIf
- @pytest.mark.windows_whitelisted
- class TestJinjaRenderer(ModuleCase):
- """
- Validate that ordering works correctly
- """
- @pytest.mark.slow_test(seconds=30) # Test takes >10 and <=30 seconds
- def test_dot_notation(self):
- """
- Test the Jinja dot-notation syntax for calling execution modules
- """
- ret = self.run_function("state.sls", ["jinja_dot_notation"])
- for state_ret in ret.values():
- self.assertTrue(state_ret["result"])
- @pytest.mark.flaky(max_runs=4)
- @skipIf(
- salt.utils.platform.is_darwin() and six.PY2, "This test hangs on OS X on Py2"
- )
- @pytest.mark.slow_test(seconds=30) # Test takes >10 and <=30 seconds
- def test_salt_contains_function(self):
- """
- Test if we are able to check if a function exists inside the "salt"
- wrapper (AliasLoader) which is available on Jinja templates.
- """
- ret = self.run_function("state.sls", ["jinja_salt_contains_function"])
- for state_ret in ret.values():
- self.assertTrue(state_ret["result"])
|