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 <flo@redhat.com>
This commit is contained in:
Sergey Orlov 2021-02-10 18:20:52 +01:00
parent 1853695d22
commit dc423661c8
No known key found for this signature in database
GPG Key ID: ADF8C90EDD04503D

View File

@ -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