test helper: create static methods .from_file() and .from_list() (#7239)

create static methods .from_file() and .from_list()
This commit is contained in:
Alexei Znamensky 2023-09-12 16:42:33 +12:00 committed by GitHub
commit bdf8852e8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 40 additions and 37 deletions

View file

@ -16,12 +16,11 @@ __metaclass__ = type
import pytest
from ansible_collections.community.general.plugins.modules import cpanm
from .cmd_runner_test_utils import CmdRunnerTestHelper
from .helper import CmdRunnerTestHelper
with open("tests/unit/plugins/modules/test_cpanm.yaml", "r") as TEST_CASES:
helper = CmdRunnerTestHelper(cpanm.main, test_cases=TEST_CASES)
patch_bin = helper.cmd_fixture
helper = CmdRunnerTestHelper.from_file(cpanm.main, "tests/unit/plugins/modules/test_cpanm.yaml")
patch_bin = helper.cmd_fixture
@pytest.mark.parametrize('patch_ansible_module, testcase',