summaryrefslogtreecommitdiffstats
path: root/test/test_import_tasks.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
commitd964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2 (patch)
tree794bc3738a00b5e599f06d1f2f6d79048d87ff8e /test/test_import_tasks.py
parentInitial commit. (diff)
downloadansible-lint-upstream.tar.xz
ansible-lint-upstream.zip
Adding upstream version 6.13.1.upstream/6.13.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test_import_tasks.py')
-rw-r--r--test/test_import_tasks.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_import_tasks.py b/test/test_import_tasks.py
new file mode 100644
index 0000000..3254121
--- /dev/null
+++ b/test/test_import_tasks.py
@@ -0,0 +1,28 @@
+"""Test related to import of invalid files."""
+import pytest
+
+from ansiblelint.rules import RulesCollection
+from ansiblelint.runner import Runner
+
+
+@pytest.mark.parametrize(
+ "playbook_path",
+ (
+ pytest.param(
+ "examples/playbooks/test_import_with_conflicting_action_statements.yml",
+ id="0",
+ ),
+ pytest.param("examples/playbooks/test_import_with_malformed.yml", id="1"),
+ ),
+)
+def test_import_tasks(
+ default_rules_collection: RulesCollection, playbook_path: str
+) -> None:
+ """Assures import_playbook includes are recognized."""
+ runner = Runner(playbook_path, rules=default_rules_collection)
+ results = runner.run()
+
+ assert len(runner.lintables) == 1
+ assert len(results) == 1
+ # Assures we detected the issues from imported file
+ assert results[0].rule.id == "syntax-check"