diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 20:04:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 20:04:50 +0000 |
commit | 782f8df6e41f29dce2db4970a3ad84aaeb7d8c5f (patch) | |
tree | 3a88a542cd8074743d251881131510157cfc510b /test/TestSkipImportPlaybook.py | |
parent | Initial commit. (diff) | |
download | ansible-lint-782f8df6e41f29dce2db4970a3ad84aaeb7d8c5f.tar.xz ansible-lint-782f8df6e41f29dce2db4970a3ad84aaeb7d8c5f.zip |
Adding upstream version 4.3.7.upstream/4.3.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/TestSkipImportPlaybook.py')
-rw-r--r-- | test/TestSkipImportPlaybook.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/TestSkipImportPlaybook.py b/test/TestSkipImportPlaybook.py new file mode 100644 index 0000000..66e8520 --- /dev/null +++ b/test/TestSkipImportPlaybook.py @@ -0,0 +1,35 @@ +import pytest + +from ansiblelint.runner import Runner + +IMPORTED_PLAYBOOK = ''' +- hosts: all + tasks: + - name: success + fail: msg="fail" + when: False +''' + +MAIN_PLAYBOOK = ''' +- hosts: all + + tasks: + - name: should be shell # noqa 305 301 + shell: echo lol + +- import_playbook: imported_playbook.yml +''' + + +@pytest.fixture +def playbook(tmp_path): + playbook_path = tmp_path / 'playbook.yml' + playbook_path.write_text(MAIN_PLAYBOOK) + (tmp_path / 'imported_playbook.yml').write_text(IMPORTED_PLAYBOOK) + return str(playbook_path) + + +def test_skip_import_playbook(default_rules_collection, playbook): + runner = Runner(default_rules_collection, playbook, [], [], []) + results = runner.run() + assert len(results) == 0 |