summaryrefslogtreecommitdiffstats
path: root/tests/units/cli/get/test_utils.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:02:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:02:00 +0000
commitab75044d21e47a84224ec8f664440d42fd5fc4be (patch)
treedda163e45555d3eecc2a63934a259a19a4b4b0fa /tests/units/cli/get/test_utils.py
parentReleasing progress-linux version 0.15.0-1. (diff)
downloadanta-ab75044d21e47a84224ec8f664440d42fd5fc4be.tar.xz
anta-ab75044d21e47a84224ec8f664440d42fd5fc4be.zip
Merging upstream version 1.0.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/units/cli/get/test_utils.py')
-rw-r--r--tests/units/cli/get/test_utils.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/units/cli/get/test_utils.py b/tests/units/cli/get/test_utils.py
index 7ce85dc..e105f94 100644
--- a/tests/units/cli/get/test_utils.py
+++ b/tests/units/cli/get/test_utils.py
@@ -19,7 +19,14 @@ from anta.inventory import AntaInventory
DATA_DIR: Path = Path(__file__).parents[3].resolve() / "data"
-def test_get_cv_token() -> None:
+@pytest.mark.parametrize(
+ "verify_cert",
+ [
+ pytest.param(True, id="Verify cert enabled"),
+ pytest.param(False, id="Verify cert disabled"),
+ ],
+)
+def test_get_cv_token(verify_cert: bool) -> None:
"""Test anta.get.utils.get_cv_token."""
ip_addr = "42.42.42.42"
username = "ant"
@@ -29,13 +36,13 @@ def test_get_cv_token() -> None:
mocked_ret = MagicMock(autospec=requests.Response)
mocked_ret.json.return_value = {"sessionId": "simple"}
patched_request.return_value = mocked_ret
- res = get_cv_token(ip_addr, username, password)
+ res = get_cv_token(ip_addr, username, password, verify_cert=verify_cert)
patched_request.assert_called_once_with(
"POST",
"https://42.42.42.42/cvpservice/login/authenticate.do",
headers={"Content-Type": "application/json", "Accept": "application/json"},
data='{"userId": "ant", "password": "formica"}',
- verify=False,
+ verify=verify_cert,
timeout=10,
)
assert res == "simple"