Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Oct 19, 2020
1 parent bf4ac2f commit ca6213a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions test/TestLocalContent.py
@@ -1,4 +1,6 @@
"""Test ability to import playbooks."""
"""Test playbooks with local content."""
import pytest

from ansiblelint.runner import Runner


Expand All @@ -24,21 +26,17 @@ def test_roles_local_content(default_rules_collection):

def test_roles_local_content_failure(default_rules_collection):
"""Assures local content in roles is found, even if Ansible itself has trouble."""
playbook_path = 'test/local-content/test-roles-failure/test.yml'
playbook_path = 'test/local-content/test-roles-failed/test.yml'
runner = Runner(default_rules_collection, playbook_path, [], [], [])
results = runner.run()

assert len(runner.playbooks) == 1
assert len(runner.playbooks) == 4
assert len(results) == 0


def test_roles_local_content_failure_complete(default_rules_collection):
"""Role with local content that is not found."""
playbook_path = 'test/local-content/test-roles-failure-complete/test.yml'
playbook_path = 'test/local-content/test-roles-failed-complete/test.yml'
runner = Runner(default_rules_collection, playbook_path, [], [], [])
results = runner.run()
print(results)
assert 1 == 0

assert len(runner.playbooks) == 1
assert len(results) == 0
with pytest.raises(SystemExit, match="^3$"):
results = runner.run()

0 comments on commit ca6213a

Please sign in to comment.