mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add tests for the jinja demands
This commit is contained in:
parent
59fe49bb2c
commit
586b81b33e
6
tests/integration/files/file/base/jinja_dot_notation.sls
Normal file
6
tests/integration/files/file/base/jinja_dot_notation.sls
Normal file
@ -0,0 +1,6 @@
|
||||
{# This syntax should be equivalent to salt['test.ping']() #}
|
||||
{% set is_true = salt.test.ping() %}
|
||||
|
||||
always-passes:
|
||||
test.succeed_without_changes:
|
||||
- name: is_true_{{ is_true }}
|
29
tests/integration/states/renderers.py
Normal file
29
tests/integration/states/renderers.py
Normal file
@ -0,0 +1,29 @@
|
||||
# coding: utf-8
|
||||
'''
|
||||
Integration tests for renderer functions
|
||||
'''
|
||||
|
||||
# Import Salt Testing libs
|
||||
from salttesting.helpers import ensure_in_syspath
|
||||
ensure_in_syspath('../../')
|
||||
|
||||
# Import salt libs
|
||||
import integration
|
||||
|
||||
|
||||
class TestJinjaRenderer(integration.ModuleCase):
|
||||
'''
|
||||
Validate that ordering works correctly
|
||||
'''
|
||||
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'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
run_tests(TestJinjaRenderer)
|
Loading…
Reference in New Issue
Block a user