Skip to content

Commit

Permalink
Refactor globs test (#4157)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored May 13, 2024
1 parent 744254a commit 0d3f69c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions examples/playbooks_globs/a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: A
hosts: localhost
tasks: []
4 changes: 4 additions & 0 deletions examples/playbooks_globs/b.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- # missing name
hosts: localhost
tasks: []
6 changes: 3 additions & 3 deletions test/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,21 @@ def test_runner_exclude_paths(default_rules_collection: RulesCollection) -> None

@pytest.mark.parametrize(
("exclude_path"),
(pytest.param("**/playbooks/*.yml", id="1"),),
(pytest.param("**/playbooks_globs/*b.yml", id="1"),),
)
def test_runner_exclude_globs(
default_rules_collection: RulesCollection,
exclude_path: str,
) -> None:
"""Test that globs work."""
runner = Runner(
"examples/playbooks",
"examples/playbooks_globs",
rules=default_rules_collection,
exclude_paths=[exclude_path],
)

matches = runner.run()
assert len(matches) == 83
assert len(matches) == 0


@pytest.mark.parametrize(
Expand Down

0 comments on commit 0d3f69c

Please sign in to comment.