mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-24 12:49:03 +00:00
Make all doc fragments, module utils, and plugin utils private (#11896)
* Make all doc fragments private. * Make all plugin utils private. * Make all module utils private. * Reformat. * Changelog fragment. * Update configs and ignores. * Adjust unit test names.
This commit is contained in:
parent
9ef1dbb6d5
commit
4fa82b9617
807 changed files with 2041 additions and 1702 deletions
|
|
@ -9,7 +9,7 @@ from __future__ import annotations
|
|||
|
||||
import unittest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.hwc_utils import are_different_dicts
|
||||
from ansible_collections.community.general.plugins.module_utils._hwc_utils import are_different_dicts
|
||||
|
||||
|
||||
class HwcDictComparisonTestCase(unittest.TestCase):
|
||||
|
|
@ -6,7 +6,7 @@ from __future__ import annotations
|
|||
|
||||
import unittest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.hwc_utils import HwcModuleException, navigate_value
|
||||
from ansible_collections.community.general.plugins.module_utils._hwc_utils import HwcModuleException, navigate_value
|
||||
|
||||
|
||||
class HwcUtilsTestCase(unittest.TestCase):
|
||||
|
|
@ -10,7 +10,7 @@ from urllib.error import HTTPError
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import (
|
||||
from ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak import (
|
||||
KeycloakError,
|
||||
get_token,
|
||||
)
|
||||
|
|
@ -70,7 +70,7 @@ def mock_good_connection(mocker):
|
|||
),
|
||||
}
|
||||
return mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
@ -98,7 +98,7 @@ def mock_bad_json_returned(mocker):
|
|||
"http://keycloak.url/auth/realms/master/protocol/openid-connect/token": create_wrapper('{"access_token":'),
|
||||
}
|
||||
return mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
@ -130,7 +130,7 @@ def mock_401_returned(mocker):
|
|||
),
|
||||
}
|
||||
return mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
@ -154,7 +154,7 @@ def mock_json_without_token_returned(mocker):
|
|||
),
|
||||
}
|
||||
return mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
@ -6,7 +6,7 @@ from __future__ import annotations
|
|||
|
||||
import unittest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import is_struct_included
|
||||
from ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak import is_struct_included
|
||||
|
||||
|
||||
class KeycloakIsStructIncludedTestCase(unittest.TestCase):
|
||||
|
|
@ -10,7 +10,7 @@ from unittest.mock import MagicMock
|
|||
import pytest
|
||||
from ansible.module_utils.common.dict_transformations import dict_merge
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.net_tools.pritunl import (
|
||||
from ansible_collections.community.general.plugins.module_utils._net_tools.pritunl import (
|
||||
api,
|
||||
)
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ def XenAPI():
|
|||
# First we use importlib.import_module() to import the module and assign
|
||||
# it to a local symbol.
|
||||
fake_xenapi = importlib.import_module(
|
||||
"ansible_collections.community.general.tests.unit.plugins.module_utils.xenserver.FakeXenAPI"
|
||||
"ansible_collections.community.general.tests.unit.plugins.module_utils._xenserver.FakeXenAPI"
|
||||
)
|
||||
|
||||
# Now we populate Python module cache with imported fake module using the
|
||||
|
|
@ -61,7 +61,7 @@ def xenserver(XenAPI):
|
|||
# that depend on it have to be imported inside a test function. To make
|
||||
# this easier to handle and remove some code repetition, we wrap the import
|
||||
# of xenserver module util with a fixture.
|
||||
from ansible_collections.community.general.plugins.module_utils import xenserver
|
||||
from ansible_collections.community.general.plugins.module_utils import _xenserver as xenserver
|
||||
|
||||
return xenserver
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ def test_gather_vm_params_and_facts(mocker, fake_ansible_module, XenAPI, xenserv
|
|||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.xenserver.get_xenserver_version",
|
||||
"ansible_collections.community.general.plugins.module_utils._xenserver.get_xenserver_version",
|
||||
return_value=[7, 2, 0],
|
||||
)
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ def test_set_vm_power_state_task_timeout(mocker, fake_ansible_module, XenAPI, xe
|
|||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.xenserver.wait_for_task", return_value="timeout"
|
||||
"ansible_collections.community.general.plugins.module_utils._xenserver.wait_for_task", return_value="timeout"
|
||||
)
|
||||
|
||||
with pytest.raises(FailJsonException) as exc_info:
|
||||
|
|
@ -373,7 +373,7 @@ def test_set_vm_power_state_transition_async(
|
|||
|
||||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils.xenserver.wait_for_task", return_value="")
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils._xenserver.wait_for_task", return_value="")
|
||||
|
||||
result = xenserver.set_vm_power_state(fake_ansible_module, fake_xenapi_ref("VM"), power_state_desired, timeout=1)
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ from .FakeAnsibleModule import FailJsonException
|
|||
|
||||
def test_xenserverobject_xenapi_lib_detection(mocker, fake_ansible_module, xenserver):
|
||||
"""Tests XenAPI lib detection code."""
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils.xenserver.HAS_XENAPI", new=False)
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils._xenserver.HAS_XENAPI", new=False)
|
||||
|
||||
with pytest.raises(FailJsonException) as exc_info:
|
||||
xenserver.XenServerObject(fake_ansible_module)
|
||||
|
|
@ -9,7 +9,7 @@ from unittest.mock import MagicMock, PropertyMock
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
|
||||
from ansible_collections.community.general.plugins.module_utils._cmd_runner import CmdRunner, cmd_runner_fmt
|
||||
|
||||
TC_FORMATS = dict(
|
||||
simple_boolean__true=(partial(cmd_runner_fmt.as_bool, "--superflag"), True, ["--superflag"], None),
|
||||
|
|
@ -8,7 +8,7 @@ import typing as t
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils import csv
|
||||
from ansible_collections.community.general.plugins.module_utils import _csv as csv
|
||||
|
||||
VALID_CSV = [
|
||||
(
|
||||
|
|
@ -9,7 +9,7 @@ from unittest.mock import MagicMock
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils import deps
|
||||
from ansible_collections.community.general.plugins.module_utils import _deps as deps
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -7,7 +7,7 @@ from __future__ import annotations
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import cause_changes
|
||||
from ansible_collections.community.general.plugins.module_utils._module_helper import cause_changes
|
||||
|
||||
#
|
||||
# DEPRECATION NOTICE
|
||||
|
|
@ -10,7 +10,7 @@ import shutil
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.ocapi_utils import OcapiUtils
|
||||
from ansible_collections.community.general.plugins.module_utils._ocapi_utils import OcapiUtils
|
||||
|
||||
|
||||
class TestOcapiUtils(unittest.TestCase):
|
||||
|
|
@ -8,7 +8,7 @@ import os
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.onepassword import OnePasswordConfig
|
||||
from ansible_collections.community.general.plugins.module_utils._onepassword import OnePasswordConfig
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -8,7 +8,7 @@ import textwrap
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.opennebula import flatten, render
|
||||
from ansible_collections.community.general.plugins.module_utils._opennebula import flatten, render
|
||||
|
||||
FLATTEN_VALID = [
|
||||
([[[1]], [2], 3], False, [1, 2, 3]),
|
||||
|
|
@ -9,8 +9,8 @@ from unittest.mock import MagicMock, PropertyMock
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import cmd_runner_fmt
|
||||
from ansible_collections.community.general.plugins.module_utils.python_runner import PythonRunner
|
||||
from ansible_collections.community.general.plugins.module_utils._cmd_runner import cmd_runner_fmt
|
||||
from ansible_collections.community.general.plugins.module_utils._python_runner import PythonRunner
|
||||
|
||||
TC_RUNNER = dict(
|
||||
# SAMPLE: This shows all possible elements of a test case. It does not actually run.
|
||||
|
|
@ -6,7 +6,7 @@ from __future__ import annotations
|
|||
|
||||
import unittest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import SecretVariables, argon2
|
||||
from ansible_collections.community.general.plugins.module_utils._scaleway import SecretVariables, argon2
|
||||
|
||||
|
||||
class SecretVariablesTestCase(unittest.TestCase):
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.utm_utils import UTM
|
||||
from ansible_collections.community.general.plugins.module_utils._utm_utils import UTM
|
||||
|
||||
|
||||
class FakeModule:
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.vardict import VarDict
|
||||
from ansible_collections.community.general.plugins.module_utils._vardict import VarDict
|
||||
|
||||
|
||||
def test_var_simple():
|
||||
|
|
@ -13,7 +13,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
set_module_args as _set_module_args,
|
||||
)
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils import deps
|
||||
from ansible_collections.community.general.plugins.module_utils import _deps as deps
|
||||
|
||||
|
||||
def _fix_ansible_args(args):
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ if "hpOneView" not in sys.modules:
|
|||
sys.modules["hpOneView"] = Mock()
|
||||
sys.modules["hpOneView.oneview_client"] = Mock()
|
||||
|
||||
ONEVIEW_MODULE_UTILS_PATH = "ansible_collections.community.general.plugins.module_utils.oneview"
|
||||
from ansible_collections.community.general.plugins.module_utils.oneview import ( # noqa: F401, pylint: disable=unused-import
|
||||
ONEVIEW_MODULE_UTILS_PATH = "ansible_collections.community.general.plugins.module_utils._oneview"
|
||||
from ansible_collections.community.general.plugins.module_utils._oneview import ( # noqa: F401, pylint: disable=unused-import
|
||||
OneViewModuleBase,
|
||||
OneViewModuleException,
|
||||
OneViewModuleResourceNotFound,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
set_module_args,
|
||||
)
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.module_utils._source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.modules import bitbucket_access_key
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
set_module_args,
|
||||
)
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.module_utils._source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.modules import bitbucket_pipeline_key_pair
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
set_module_args,
|
||||
)
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.module_utils._source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.modules import bitbucket_pipeline_known_host
|
||||
from ansible_collections.community.general.plugins.modules.bitbucket_pipeline_known_host import HAS_PARAMIKO
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
set_module_args,
|
||||
)
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.module_utils._source_control.bitbucket import BitbucketHelper
|
||||
from ansible_collections.community.general.plugins.modules import bitbucket_pipeline_variable
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from __future__ import annotations
|
|||
|
||||
import pytest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
from ansible_collections.community.general.plugins.module_utils._version import LooseVersion
|
||||
from ansible_collections.community.general.plugins.modules.gitlab_protected_branch import GitlabProtectedBranch
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from __future__ import annotations
|
|||
|
||||
import unittest
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.homebrew import HomebrewValidate
|
||||
from ansible_collections.community.general.plugins.module_utils._homebrew import HomebrewValidate
|
||||
|
||||
|
||||
class TestHomebrewModule(unittest.TestCase):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.homebrew import (
|
||||
from ansible_collections.community.general.plugins.module_utils._homebrew import (
|
||||
HomebrewValidate,
|
||||
)
|
||||
from ansible_collections.community.general.plugins.modules.homebrew_cask import (
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
set_module_args,
|
||||
)
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.mh.deco import no_handle_exceptions
|
||||
from ansible_collections.community.general.plugins.module_utils._mh.deco import no_handle_exceptions
|
||||
from ansible_collections.community.general.plugins.modules import icinga2_downtime
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ def _mock_good_connection():
|
|||
)
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=_build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ def mock_good_connection():
|
|||
),
|
||||
}
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak.open_url",
|
||||
"ansible_collections.community.general.plugins.module_utils._identity.keycloak.keycloak.open_url",
|
||||
side_effect=build_mocked_request(count(), token_response),
|
||||
autospec=True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
from linode_api4 import LinodeClient
|
||||
from linode_api4.errors import ApiError as LinodeApiError
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.linode import get_user_agent
|
||||
from ansible_collections.community.general.plugins.module_utils._linode import get_user_agent
|
||||
from ansible_collections.community.general.plugins.modules import linode_v4
|
||||
|
||||
from .linode_conftest import ( # noqa: F401, pylint: disable=unused-import
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ from ansible_collections.community.general.plugins.modules import lxca_cmms
|
|||
|
||||
@pytest.fixture(scope="module")
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.close_conn", autospec=True
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.close_conn",
|
||||
autospec=True,
|
||||
)
|
||||
def setup_module(close_conn):
|
||||
close_conn.return_value = True
|
||||
|
|
@ -42,7 +43,7 @@ class TestMyModule:
|
|||
)
|
||||
@pytest.mark.usefixtures("patch_ansible_module")
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn",
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.setup_conn",
|
||||
autospec=True,
|
||||
)
|
||||
@mock.patch("ansible_collections.community.general.plugins.modules.lxca_cmms.execute_module", autospec=True)
|
||||
|
|
@ -58,7 +59,7 @@ class TestMyModule:
|
|||
assert "missing required arguments" in results["msg"]
|
||||
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn",
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.setup_conn",
|
||||
autospec=True,
|
||||
)
|
||||
@mock.patch("ansible_collections.community.general.plugins.modules.lxca_cmms.execute_module", autospec=True)
|
||||
|
|
@ -86,7 +87,7 @@ class TestMyModule:
|
|||
assert mock.call(argument_spec=expected_arguments_spec, supports_check_mode=False) == ansible_mod_cls.call_args
|
||||
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn",
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.setup_conn",
|
||||
autospec=True,
|
||||
)
|
||||
@mock.patch("ansible_collections.community.general.plugins.modules.lxca_cmms._cmms_by_uuid", autospec=True)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ from ansible_collections.community.general.plugins.modules import lxca_nodes
|
|||
|
||||
@pytest.fixture(scope="module")
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.close_conn", autospec=True
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.close_conn",
|
||||
autospec=True,
|
||||
)
|
||||
def setup_module(close_conn):
|
||||
close_conn.return_value = True
|
||||
|
|
@ -42,7 +43,7 @@ class TestMyModule:
|
|||
)
|
||||
@pytest.mark.usefixtures("patch_ansible_module")
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn",
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.setup_conn",
|
||||
autospec=True,
|
||||
)
|
||||
@mock.patch("ansible_collections.community.general.plugins.modules.lxca_nodes.execute_module", autospec=True)
|
||||
|
|
@ -58,7 +59,7 @@ class TestMyModule:
|
|||
assert "missing required arguments" in results["msg"]
|
||||
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn",
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.setup_conn",
|
||||
autospec=True,
|
||||
)
|
||||
@mock.patch("ansible_collections.community.general.plugins.modules.lxca_nodes.execute_module", autospec=True)
|
||||
|
|
@ -95,7 +96,7 @@ class TestMyModule:
|
|||
assert mock.call(argument_spec=expected_arguments_spec, supports_check_mode=False) == ansible_mod_cls.call_args
|
||||
|
||||
@mock.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn",
|
||||
"ansible_collections.community.general.plugins.module_utils._remote_management.lxca.common.setup_conn",
|
||||
autospec=True,
|
||||
)
|
||||
@mock.patch("ansible_collections.community.general.plugins.modules.lxca_nodes._nodes_by_uuid", autospec=True)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import dns.update
|
|||
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args
|
||||
|
||||
import ansible_collections.community.general.plugins.modules.nsupdate as nsupdate_module
|
||||
from ansible_collections.community.general.plugins.module_utils import deps
|
||||
from ansible_collections.community.general.plugins.module_utils import _deps as deps
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fixtures
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
def test_set_power_mode(self):
|
||||
"""Test that we can set chassis power mode"""
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
):
|
||||
|
|
@ -192,7 +192,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
def test_set_chassis_led_indicator(self):
|
||||
"""Test that we can set chassis LED indicator."""
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
):
|
||||
|
|
@ -213,7 +213,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
def test_set_power_mode_already_set(self):
|
||||
"""Test that if we set Power Mode to normal when it's already normal, we get changed=False."""
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
):
|
||||
|
|
@ -234,7 +234,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
def test_set_power_mode_check_mode(self):
|
||||
"""Test check mode when setting chassis Power Mode."""
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
):
|
||||
|
|
@ -256,7 +256,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
def test_set_chassis_led_indicator_check_mode(self):
|
||||
"""Test check mode when setting chassis LED indicator"""
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
):
|
||||
|
|
@ -278,7 +278,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
def test_set_chassis_led_indicator_already_set(self):
|
||||
"""Test that if we set LED Indicator to off when it's already off, we get changed=False."""
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
):
|
||||
|
|
@ -299,7 +299,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
def test_set_chassis_led_indicator_already_set_check_mode(self):
|
||||
"""Test that if we set LED Indicator to off when it's already off, we get changed=False even in check mode."""
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
):
|
||||
|
|
@ -320,7 +320,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_set_chassis_invalid_indicator_command(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
):
|
||||
|
|
@ -339,7 +339,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_reset_enclosure(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
):
|
||||
|
|
@ -359,7 +359,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_reset_enclosure_check_mode(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
):
|
||||
|
|
@ -380,7 +380,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_firmware_upload_missing_update_image_path(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
):
|
||||
|
|
@ -399,7 +399,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_firmware_upload_file_not_found(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
):
|
||||
|
|
@ -425,7 +425,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
f.write(file_contents)
|
||||
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
post_request=mock_post_request,
|
||||
|
|
@ -453,7 +453,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
f.write(file_contents)
|
||||
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
post_request=mock_invalid_http_request,
|
||||
|
|
@ -476,7 +476,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_firmware_update(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
post_request=mock_invalid_http_request,
|
||||
|
|
@ -497,7 +497,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_firmware_update_check_mode(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
post_request=mock_invalid_http_request,
|
||||
|
|
@ -519,7 +519,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_firmware_activate(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
post_request=mock_invalid_http_request,
|
||||
|
|
@ -540,7 +540,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_firmware_activate_check_mode(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
post_request=mock_invalid_http_request,
|
||||
|
|
@ -562,7 +562,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_delete_job(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request_job_complete,
|
||||
delete_request=mock_delete_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
|
|
@ -585,7 +585,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_delete_job_in_progress(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request_job_in_progress,
|
||||
delete_request=mock_invalid_http_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
|
|
@ -607,7 +607,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_delete_job_in_progress_only_on_delete(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request_job_complete,
|
||||
delete_request=mock_http_request_conflict,
|
||||
put_request=mock_invalid_http_request,
|
||||
|
|
@ -629,7 +629,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_delete_job_check_mode(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request_job_complete,
|
||||
delete_request=mock_delete_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
|
|
@ -653,7 +653,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_delete_job_check_mode_job_not_found(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request_job_does_not_exist,
|
||||
delete_request=mock_delete_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
|
|
@ -677,7 +677,7 @@ class TestOcapiCommand(unittest.TestCase):
|
|||
|
||||
def test_delete_job_check_mode_job_in_progress(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request_job_in_progress,
|
||||
delete_request=mock_delete_request,
|
||||
put_request=mock_invalid_http_request,
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class TestOcapiInfo(unittest.TestCase):
|
|||
|
||||
def test_job_status_in_progress(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
delete_request=mock_delete_request,
|
||||
|
|
@ -182,7 +182,7 @@ class TestOcapiInfo(unittest.TestCase):
|
|||
|
||||
def test_job_status_complete(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
delete_request=mock_delete_request,
|
||||
|
|
@ -224,7 +224,7 @@ class TestOcapiInfo(unittest.TestCase):
|
|||
|
||||
def test_job_status_not_found(self):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.ocapi_utils.OcapiUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._ocapi_utils.OcapiUtils",
|
||||
get_request=mock_get_request,
|
||||
put_request=mock_put_request,
|
||||
delete_request=mock_delete_request,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ def patch_bin(mocker):
|
|||
@pytest.mark.usefixtures("patch_bin")
|
||||
def test_present_race_condition_stopped_then_started(mocker, capfd):
|
||||
"""Resource reports Stopped on the first poll then Started on the second — must succeed."""
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils.pacemaker.time.sleep")
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils._pacemaker.time.sleep")
|
||||
|
||||
# Sequence of run_command calls:
|
||||
# 1. initial _get(): resource status → not found (rc=1)
|
||||
|
|
@ -99,12 +99,12 @@ def test_present_race_condition_stopped_then_started(mocker, capfd):
|
|||
@pytest.mark.usefixtures("patch_bin")
|
||||
def test_present_wait_timeout_raises(mocker, capfd):
|
||||
"""Resource never starts within the wait window — must fail with a timeout message."""
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils.pacemaker.time.sleep")
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils._pacemaker.time.sleep")
|
||||
|
||||
# Simulate time advancing past the deadline immediately on the first poll
|
||||
monotonic_values = iter([0.0, 999.0])
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.pacemaker.time.monotonic",
|
||||
"ansible_collections.community.general.plugins.module_utils._pacemaker.time.monotonic",
|
||||
side_effect=lambda: next(monotonic_values),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ def patch_bin(mocker):
|
|||
@pytest.mark.usefixtures("patch_bin")
|
||||
def test_present_race_condition_stopped_then_started(mocker, capfd):
|
||||
"""Resource reports Stopped on the first poll then Started on the second — must succeed."""
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils.pacemaker.time.sleep")
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils._pacemaker.time.sleep")
|
||||
|
||||
# Sequence of run_command calls:
|
||||
# 1. initial _get(): stonith status → not found (rc=1)
|
||||
|
|
@ -87,12 +87,12 @@ def test_present_race_condition_stopped_then_started(mocker, capfd):
|
|||
@pytest.mark.usefixtures("patch_bin")
|
||||
def test_present_wait_timeout_raises(mocker, capfd):
|
||||
"""Resource never starts within the wait window — must fail with a timeout message."""
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils.pacemaker.time.sleep")
|
||||
mocker.patch("ansible_collections.community.general.plugins.module_utils._pacemaker.time.sleep")
|
||||
|
||||
# Simulate time advancing past the deadline immediately on the first poll
|
||||
monotonic_values = iter([0.0, 999.0])
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.pacemaker.time.monotonic",
|
||||
"ansible_collections.community.general.plugins.module_utils._pacemaker.time.monotonic",
|
||||
side_effect=lambda: next(monotonic_values),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
from ansible_collections.community.general.plugins.modules import (
|
||||
pritunl_org,
|
||||
)
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils.net_tools.pritunl.test_api import (
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils._net_tools.pritunl.test_api import (
|
||||
PritunlDeleteOrganizationMock,
|
||||
PritunlListOrganizationAfterPostMock,
|
||||
PritunlListOrganizationMock,
|
||||
|
|
@ -35,21 +35,21 @@ class TestPritunlOrg(ModuleTestCase):
|
|||
|
||||
def patch_add_pritunl_organization(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._post_pritunl_organization",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._post_pritunl_organization",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
||||
def patch_delete_pritunl_organization(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._delete_pritunl_organization",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._delete_pritunl_organization",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
||||
def patch_get_pritunl_organizations(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._get_pritunl_organizations",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._get_pritunl_organizations",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
from ansible_collections.community.general.plugins.modules import (
|
||||
pritunl_org_info,
|
||||
)
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils.net_tools.pritunl.test_api import (
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils._net_tools.pritunl.test_api import (
|
||||
PritunlEmptyOrganizationMock,
|
||||
PritunlListOrganizationMock,
|
||||
)
|
||||
|
|
@ -32,7 +32,7 @@ class TestPritunlOrgInfo(ModuleTestCase):
|
|||
|
||||
def patch_get_pritunl_organizations(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._get_pritunl_organizations",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._get_pritunl_organizations",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
from ansible_collections.community.general.plugins.modules import (
|
||||
pritunl_user,
|
||||
)
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils.net_tools.pritunl.test_api import (
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils._net_tools.pritunl.test_api import (
|
||||
PritunlDeleteUserMock,
|
||||
PritunlListOrganizationMock,
|
||||
PritunlListUserMock,
|
||||
|
|
@ -47,35 +47,35 @@ class TestPritunlUser(ModuleTestCase):
|
|||
|
||||
def patch_get_pritunl_users(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._get_pritunl_users",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._get_pritunl_users",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
||||
def patch_add_pritunl_users(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._post_pritunl_user",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._post_pritunl_user",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
||||
def patch_update_pritunl_users(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._put_pritunl_user",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._put_pritunl_user",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
||||
def patch_delete_pritunl_users(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._delete_pritunl_user",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._delete_pritunl_user",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
||||
def patch_get_pritunl_organizations(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._get_pritunl_organizations",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._get_pritunl_organizations",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.plugins.module
|
|||
from ansible_collections.community.general.plugins.modules import (
|
||||
pritunl_user_info,
|
||||
)
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils.net_tools.pritunl.test_api import (
|
||||
from ansible_collections.community.general.tests.unit.plugins.module_utils._net_tools.pritunl.test_api import (
|
||||
PritunlListOrganizationMock,
|
||||
PritunlListUserMock,
|
||||
)
|
||||
|
|
@ -32,14 +32,14 @@ class TestPritunlUserInfo(ModuleTestCase):
|
|||
|
||||
def patch_get_pritunl_users(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._get_pritunl_users",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._get_pritunl_users",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
||||
def patch_get_pritunl_organizations(self, **kwds):
|
||||
return patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.net_tools.pritunl.api._get_pritunl_organizations",
|
||||
"ansible_collections.community.general.plugins.module_utils._net_tools.pritunl.api._get_pritunl_organizations",
|
||||
autospec=True,
|
||||
**kwds,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from unittest.mock import patch
|
|||
import pytest
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import Response, Scaleway
|
||||
from ansible_collections.community.general.plugins.module_utils._scaleway import Response, Scaleway
|
||||
from ansible_collections.community.general.plugins.modules import scaleway_compute_private_network
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from unittest.mock import patch
|
|||
import pytest
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import Response, Scaleway
|
||||
from ansible_collections.community.general.plugins.module_utils._scaleway import Response, Scaleway
|
||||
from ansible_collections.community.general.plugins.modules import scaleway_private_network
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ sys.modules["hpe3par_sdk"] = mock.Mock()
|
|||
sys.modules["hpe3par_sdk.client"] = mock.Mock()
|
||||
sys.modules["hpe3parclient"] = mock.Mock()
|
||||
sys.modules["hpe3parclient.exceptions"] = mock.Mock()
|
||||
from ansible_collections.community.general.plugins.module_utils.storage.hpe3par import hpe3par
|
||||
from ansible_collections.community.general.plugins.module_utils._storage.hpe3par import hpe3par
|
||||
from ansible_collections.community.general.plugins.modules import ss_3par_cpg
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
}
|
||||
with set_module_args(module_args):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
get_request=mock_get_request,
|
||||
post_request=mock_post_request,
|
||||
):
|
||||
|
|
@ -283,7 +283,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
}
|
||||
with set_module_args(module_args):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
get_request=mock_get_request,
|
||||
):
|
||||
with self.assertRaises(AnsibleExitJson) as ansible_exit_json:
|
||||
|
|
@ -303,7 +303,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
}
|
||||
with set_module_args(module_args):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
get_request=mock_get_request,
|
||||
):
|
||||
with self.assertRaises(AnsibleFailJson) as ansible_fail_json:
|
||||
|
|
@ -323,7 +323,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
}
|
||||
with set_module_args(module_args):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
get_request=mock_get_request,
|
||||
post_request=mock_post_request,
|
||||
):
|
||||
|
|
@ -344,7 +344,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
}
|
||||
with set_module_args(module_args):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
get_request=mock_get_request,
|
||||
post_request=mock_post_request,
|
||||
):
|
||||
|
|
@ -365,7 +365,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
}
|
||||
with set_module_args(module_args):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
get_request=mock_get_request,
|
||||
):
|
||||
with self.assertRaises(AnsibleExitJson) as ansible_exit_json:
|
||||
|
|
@ -420,7 +420,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
module_args.update(uri_specifier)
|
||||
with set_module_args(module_args):
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
_firmware_activate_uri=mock_fw_activate_url,
|
||||
_update_uri=mock_update_url,
|
||||
_find_updateservice_resource=empty_return,
|
||||
|
|
@ -538,7 +538,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
}
|
||||
):
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = mock_filename
|
||||
with patch.multiple(
|
||||
|
|
@ -571,7 +571,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
empty_tarfile = tarfile.open(os.path.join(self.tempdir, tar_name), "w")
|
||||
empty_tarfile.close()
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name)
|
||||
with patch.multiple(
|
||||
|
|
@ -603,7 +603,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
):
|
||||
tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, is_multi_tenant=False)
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name)
|
||||
with patch.multiple(
|
||||
|
|
@ -638,7 +638,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
):
|
||||
tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, is_multi_tenant=True)
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name)
|
||||
with patch.multiple(
|
||||
|
|
@ -673,11 +673,11 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, is_multi_tenant=False)
|
||||
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name)
|
||||
with patch.multiple(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils",
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils",
|
||||
get_firmware_inventory=mock_get_firmware_inventory_version_1_2_3,
|
||||
simple_update=mock_simple_update,
|
||||
_simple_update_status_uri=mocked_url_response,
|
||||
|
|
@ -687,7 +687,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
post_request=mock_post_request,
|
||||
):
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils.get_simple_update_status"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils.get_simple_update_status"
|
||||
) as mock_get_simple_update_status:
|
||||
mock_get_simple_update_status.side_effect = MOCK_SIMPLE_UPDATE_STATUS_LIST
|
||||
with self.assertRaises(AnsibleExitJson) as ansible_exit_json:
|
||||
|
|
@ -712,7 +712,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, is_multi_tenant=True)
|
||||
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name)
|
||||
with patch.multiple(
|
||||
|
|
@ -726,7 +726,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
post_request=mock_post_request,
|
||||
):
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils.get_simple_update_status"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils.get_simple_update_status"
|
||||
) as mock_get_simple_update_status:
|
||||
mock_get_simple_update_status.side_effect = MOCK_SIMPLE_UPDATE_STATUS_LIST
|
||||
with self.assertRaises(AnsibleExitJson) as ansible_exit_json:
|
||||
|
|
@ -751,7 +751,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
):
|
||||
tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, is_multi_tenant=True)
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name)
|
||||
with patch.multiple(
|
||||
|
|
@ -785,7 +785,7 @@ class TestWdcRedfishCommand(unittest.TestCase):
|
|||
):
|
||||
tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, is_multi_tenant=False)
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.fetch_file"
|
||||
) as mock_fetch_file:
|
||||
mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name)
|
||||
with patch.multiple(
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ class TestWdcRedfishInfo(unittest.TestCase):
|
|||
raise RuntimeError(f"Illegal call to get_request in test: {uri}")
|
||||
|
||||
with patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils.get_request"
|
||||
"ansible_collections.community.general.plugins.module_utils._wdc_redfish_utils.WdcRedfishUtils.get_request"
|
||||
) as mock_get_request:
|
||||
mock_get_request.side_effect = mock_get_request_function
|
||||
with self.assertRaises(AnsibleFailJson) as ansible_exit_json:
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ def test_xenserver_guest_info(mocker, capfd, XenAPI, xenserver_guest_info):
|
|||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.xenserver.get_xenserver_version",
|
||||
"ansible_collections.community.general.plugins.module_utils._xenserver.get_xenserver_version",
|
||||
return_value=[7, 2, 0],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ def test_xenserver_guest_powerstate_set_power_state(
|
|||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.xenserver.get_xenserver_version",
|
||||
"ansible_collections.community.general.plugins.module_utils._xenserver.get_xenserver_version",
|
||||
return_value=[7, 2, 0],
|
||||
)
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ def test_xenserver_guest_powerstate_present(mocker, patch_ansible_module, capfd,
|
|||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.xenserver.get_xenserver_version",
|
||||
"ansible_collections.community.general.plugins.module_utils._xenserver.get_xenserver_version",
|
||||
return_value=[7, 2, 0],
|
||||
)
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ def test_xenserver_guest_powerstate_other(mocker, patch_ansible_module, capfd, X
|
|||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.xenserver.get_xenserver_version",
|
||||
"ansible_collections.community.general.plugins.module_utils._xenserver.get_xenserver_version",
|
||||
return_value=[7, 2, 0],
|
||||
)
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ def test_xenserver_guest_powerstate_wait(mocker, patch_ansible_module, capfd, Xe
|
|||
mocked_xenapi.configure_mock(**mocked_returns)
|
||||
|
||||
mocker.patch(
|
||||
"ansible_collections.community.general.plugins.module_utils.xenserver.get_xenserver_version",
|
||||
"ansible_collections.community.general.plugins.module_utils._xenserver.get_xenserver_version",
|
||||
return_value=[7, 2, 0],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from ansible_collections.community.internal_test_tools.tests.unit.utils.trust im
|
|||
make_untrusted as _make_untrusted,
|
||||
)
|
||||
|
||||
from ansible_collections.community.general.plugins.plugin_utils.unsafe import (
|
||||
from ansible_collections.community.general.plugins.plugin_utils._unsafe import (
|
||||
make_unsafe,
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue