File: test_adjacent_plugins.py

package info (click to toggle)
ansible-lint 25.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,660 kB
  • sloc: python: 19,201; sh: 70; makefile: 7
file content (25 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Test ability to recognize adjacent modules/plugins."""

import logging

import pytest

from ansiblelint.rules import RulesCollection
from ansiblelint.runner import Runner


def test_adj_action(
    default_rules_collection: RulesCollection,
    caplog: pytest.LogCaptureFixture,
) -> None:
    """Assures local collections are found."""
    playbook_path = "examples/playbooks/adj_action.yml"

    with caplog.at_level(logging.DEBUG):
        runner = Runner(playbook_path, rules=default_rules_collection, verbosity=1)
        results = runner.run()
    assert "Unable to load module" not in caplog.text
    assert "Unable to resolve FQCN" not in caplog.text

    assert len(runner.lintables) == 1
    assert len(results) == 0