Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed May 31, 2023
1 parent c78e7a4 commit 0f077cf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
WSLENV: FORCE_COLOR:PYTEST_REQPASS:TOXENV:GITHUB_STEP_SUMMARY
# Number of expected test passes, safety measure for accidental skip of
# tests. Update value if you add/remove tests.
PYTEST_REQPASS: 803
PYTEST_REQPASS: 804
steps:
- name: Activate WSL1
if: "contains(matrix.shell, 'wsl')"
Expand Down
10 changes: 10 additions & 0 deletions examples/playbooks/rule-schema-become-method-fail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Test 'become_method' plugin validity
hosts: localhost
become: true
become_method: this_is_not_an_installed_plugin
tasks:
- name: Another example
ansible.builtin.debug:
msg: "This should not be reached"
become_method: this_is_not_an_installed_plugin
11 changes: 10 additions & 1 deletion src/ansiblelint/rules/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,20 @@ def matchyaml(self, file: Lintable) -> list[MatchError]:
id="rulebook2",
),
pytest.param(
"examples/playbooks/rule-schema-become-method.yml",
"examples/playbooks/rule-schema-become-method-pass.yml",
"playbook",
[],
id="playbook",
),
pytest.param(
"examples/playbooks/rule-schema-become-method-fail.yml",
"playbook",
[
"'become_method' must be one of the currently installed plugins",
"'become_method' must be one of the currently installed plugins",
],
id="playbook2",
),
),
)
def test_schema(file: str, expected_kind: str, expected: list[str]) -> None:
Expand Down

0 comments on commit 0f077cf

Please sign in to comment.