summaryrefslogtreecommitdiffstats
path: root/test/TestImportPlaybook.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/TestImportPlaybook.py')
-rw-r--r--test/TestImportPlaybook.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/TestImportPlaybook.py b/test/TestImportPlaybook.py
new file mode 100644
index 0000000..06492e3
--- /dev/null
+++ b/test/TestImportPlaybook.py
@@ -0,0 +1,17 @@
+"""Test ability to import playbooks."""
+from ansiblelint.runner import Runner
+
+
+def test_task_hook_import_playbook(default_rules_collection):
+ """Assures import_playbook includes are recognized."""
+ playbook_path = 'test/playbook-import/playbook_parent.yml'
+ runner = Runner(default_rules_collection, playbook_path, [], [], [])
+ results = runner.run()
+
+ results_text = str(results)
+ assert len(runner.playbooks) == 2
+ assert len(results) == 2
+ # Assures we detected the issues from imported playbook
+ assert 'Commands should not change things' in results_text
+ assert '502' in results_text
+ assert 'All tasks should be named' in results_text