mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Migrate tests/integration/ssh/test_jinja_filters.py
to pytest
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
c3d4aee8e9
commit
f483d671cb
2 changed files with 27 additions and 1 deletions
27
tests/pytests/integration/ssh/test_jinja_filters.py
Normal file
27
tests/pytests/integration/ssh/test_jinja_filters.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import pytest
|
||||
from saltfactories.utils.functional import StateResult
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.slow_test,
|
||||
pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"),
|
||||
]
|
||||
|
||||
|
||||
def test_dateutils_strftime(salt_master, salt_ssh_cli):
|
||||
"""
|
||||
test jinja filter datautils.strftime
|
||||
"""
|
||||
sls_contents = """
|
||||
{% set result = none | strftime('%Y-%m-%d') %}
|
||||
test:
|
||||
module.run:
|
||||
- name: test.echo
|
||||
- text: {{ result }}
|
||||
"""
|
||||
with salt_master.state_tree.base.temp_file("dateutils.sls", sls_contents):
|
||||
ret = salt_ssh_cli.run("state.sls", "dateutils")
|
||||
assert ret.returncode == 0
|
||||
staterun = StateResult(ret.data)
|
||||
assert staterun.result is True
|
||||
assert staterun.changes
|
||||
assert "ret" in staterun.changes
|
|
@ -166,7 +166,6 @@ class BadTestModuleNamesTestCase(TestCase):
|
|||
"integration.spm.test_repo",
|
||||
"integration.ssh.test_deploy",
|
||||
"integration.ssh.test_grains",
|
||||
"integration.ssh.test_jinja_filters",
|
||||
"integration.ssh.test_master",
|
||||
"integration.ssh.test_mine",
|
||||
"integration.ssh.test_pillar",
|
||||
|
|
Loading…
Add table
Reference in a new issue