From dc423661c81ecbbd8f6d80ec1db06f292af59148 Mon Sep 17 00:00:00 2001 From: Sergey Orlov Date: Wed, 10 Feb 2021 18:20:52 +0100 Subject: [PATCH] ipatests: mock resolver factory test_testconfig is using hardcoded hostnames which do not match ones provided in real test config. This causes resolver factory to fail when trying to detect resolver type of the host. Related to https://pagure.io/freeipa/issue/8703 Reviewed-By: Florence Blanc-Renaud --- ipatests/test_integration/test_testconfig.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ipatests/test_integration/test_testconfig.py b/ipatests/test_integration/test_testconfig.py index 8749d7144..b4876dfad 100644 --- a/ipatests/test_integration/test_testconfig.py +++ b/ipatests/test_integration/test_testconfig.py @@ -20,7 +20,10 @@ import json import copy +from unittest.mock import patch, MagicMock + from ipatests.pytest_ipa.integration import config +import ipatests.pytest_ipa.integration.host from ipapython.ipautil import write_tmp_file from ipatests.util import assert_deepequal from ipalib.constants import MAX_DOMAIN_LEVEL @@ -84,6 +87,7 @@ def extend_dict(defaults, *others, **kwargs): return copy.deepcopy(result) +@patch.object(ipatests.pytest_ipa.integration.host, 'resolver', MagicMock()) class CheckConfig: def check_config(self, conf): pass