|
|
23f808 |
From 14c7619284c5d29507b74d87c01b7c2d362be5c5 Mon Sep 17 00:00:00 2001
|
|
|
23f808 |
From: Rob Crittenden <rcritten@redhat.com>
|
|
|
23f808 |
Date: Tue, 6 Aug 2019 16:00:24 -0400
|
|
|
23f808 |
Subject: [PATCH 4/8] Create a default set of mock to always apply to all test
|
|
|
23f808 |
cases
|
|
|
23f808 |
|
|
|
23f808 |
There are some common cases related to initialization where it makes
|
|
|
23f808 |
sense to centralize them in the base class.
|
|
|
23f808 |
---
|
|
|
23f808 |
tests/base.py | 15 ++++++++++++-
|
|
|
23f808 |
tests/test_dogtag_ca.py | 2 --
|
|
|
23f808 |
tests/test_dogtag_connectivity.py | 2 --
|
|
|
23f808 |
tests/test_ds_replication.py | 7 +-----
|
|
|
23f808 |
tests/test_ipa_agent.py | 2 --
|
|
|
23f808 |
tests/test_ipa_certfile_expiration.py | 2 --
|
|
|
23f808 |
tests/test_ipa_certmonger_ca.py | 2 --
|
|
|
23f808 |
tests/test_ipa_dna.py | 7 +-----
|
|
|
23f808 |
tests/test_ipa_expiration.py | 2 --
|
|
|
23f808 |
tests/test_ipa_nssdb.py | 2 --
|
|
|
23f808 |
tests/test_ipa_nssvalidation.py | 2 --
|
|
|
23f808 |
tests/test_ipa_opensslvalidation.py | 2 --
|
|
|
23f808 |
tests/test_ipa_revocation.py | 2 --
|
|
|
23f808 |
tests/test_ipa_roles.py | 12 +---------
|
|
|
23f808 |
tests/test_ipa_topology.py | 6 -----
|
|
|
23f808 |
tests/test_ipa_tracking.py | 2 --
|
|
|
23f808 |
tests/test_ipa_trust.py | 32 ---------------------------
|
|
|
23f808 |
tests/test_meta_services.py | 6 -----
|
|
|
23f808 |
18 files changed, 17 insertions(+), 90 deletions(-)
|
|
|
23f808 |
|
|
|
23f808 |
diff --git a/tests/base.py b/tests/base.py
|
|
|
23f808 |
index 9a54941..8b9e37c 100644
|
|
|
23f808 |
--- a/tests/base.py
|
|
|
23f808 |
+++ b/tests/base.py
|
|
|
23f808 |
@@ -17,18 +17,31 @@ class BaseTest(TestCase):
|
|
|
23f808 |
|
|
|
23f808 |
If a test needs a particular value then it will need to use
|
|
|
23f808 |
@patch individually.
|
|
|
23f808 |
+
|
|
|
23f808 |
+ A default set of Mock patches is set because they apply to all or
|
|
|
23f808 |
+ nearly all test cases.
|
|
|
23f808 |
"""
|
|
|
23f808 |
+ default_patches = {
|
|
|
23f808 |
+ 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
+ mock.Mock(return_value=None),
|
|
|
23f808 |
+ }
|
|
|
23f808 |
+ patches = {}
|
|
|
23f808 |
|
|
|
23f808 |
def setup_class(self):
|
|
|
23f808 |
# collect the list of patches to be applied for this class of
|
|
|
23f808 |
# tests
|
|
|
23f808 |
+ self.default_patches.update(self.patches)
|
|
|
23f808 |
+
|
|
|
23f808 |
self.applied_patches = [
|
|
|
23f808 |
- mock.patch(patch, data) for patch, data in self.patches.items()
|
|
|
23f808 |
+ mock.patch(patch, data) for patch, data in
|
|
|
23f808 |
+ self.default_patches.items()
|
|
|
23f808 |
]
|
|
|
23f808 |
|
|
|
23f808 |
for patch in self.applied_patches:
|
|
|
23f808 |
patch.start()
|
|
|
23f808 |
|
|
|
23f808 |
+ self.results = None
|
|
|
23f808 |
+
|
|
|
23f808 |
def teardown_class(self):
|
|
|
23f808 |
mock.patch.stopall()
|
|
|
23f808 |
|
|
|
23f808 |
diff --git a/tests/test_dogtag_ca.py b/tests/test_dogtag_ca.py
|
|
|
23f808 |
index 5c7faed..b5c5351 100644
|
|
|
23f808 |
--- a/tests/test_dogtag_ca.py
|
|
|
23f808 |
+++ b/tests/test_dogtag_ca.py
|
|
|
23f808 |
@@ -37,8 +37,6 @@ class mock_CertDB:
|
|
|
23f808 |
|
|
|
23f808 |
class TestCACerts(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipaserver.install.cainstance.CAInstance':
|
|
|
23f808 |
Mock(return_value=CAInstance()),
|
|
|
23f808 |
'ipaserver.install.krainstance.KRAInstance':
|
|
|
23f808 |
diff --git a/tests/test_dogtag_connectivity.py b/tests/test_dogtag_connectivity.py
|
|
|
23f808 |
index ad57bdf..544e325 100644
|
|
|
23f808 |
--- a/tests/test_dogtag_connectivity.py
|
|
|
23f808 |
+++ b/tests/test_dogtag_connectivity.py
|
|
|
23f808 |
@@ -14,8 +14,6 @@ from ipalib.errors import CertificateOperationError
|
|
|
23f808 |
|
|
|
23f808 |
class TestCAConnectivity(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipaserver.install.cainstance.CAInstance':
|
|
|
23f808 |
Mock(return_value=CAInstance()),
|
|
|
23f808 |
}
|
|
|
23f808 |
diff --git a/tests/test_ds_replication.py b/tests/test_ds_replication.py
|
|
|
23f808 |
index dd2bfc9..b6b3652 100644
|
|
|
23f808 |
--- a/tests/test_ds_replication.py
|
|
|
23f808 |
+++ b/tests/test_ds_replication.py
|
|
|
23f808 |
@@ -4,7 +4,7 @@
|
|
|
23f808 |
|
|
|
23f808 |
import pytest
|
|
|
23f808 |
from base import BaseTest
|
|
|
23f808 |
-from unittest.mock import Mock, patch
|
|
|
23f808 |
+from unittest.mock import patch
|
|
|
23f808 |
from util import capture_results, m_api
|
|
|
23f808 |
|
|
|
23f808 |
from ipahealthcheck.core import config, constants
|
|
|
23f808 |
@@ -37,11 +37,6 @@ class mock_ldap:
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestReplicationConflicts(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
@pytest.mark.skipif(NUM_VERSION < 40790,
|
|
|
23f808 |
reason="no way of currently testing this")
|
|
|
23f808 |
@patch('ipapython.ipaldap.LDAPClient.from_realm')
|
|
|
23f808 |
diff --git a/tests/test_ipa_agent.py b/tests/test_ipa_agent.py
|
|
|
23f808 |
index f614bb1..c58c7a6 100644
|
|
|
23f808 |
--- a/tests/test_ipa_agent.py
|
|
|
23f808 |
+++ b/tests/test_ipa_agent.py
|
|
|
23f808 |
@@ -56,8 +56,6 @@ class mock_ldap_conn:
|
|
|
23f808 |
class TestNSSAgent(BaseTest):
|
|
|
23f808 |
cert = IPACertificate()
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ldap.initialize':
|
|
|
23f808 |
Mock(return_value=mock_ldap_conn()),
|
|
|
23f808 |
'ipaserver.install.cainstance.CAInstance':
|
|
|
23f808 |
diff --git a/tests/test_ipa_certfile_expiration.py b/tests/test_ipa_certfile_expiration.py
|
|
|
23f808 |
index 61cb29b..d5601c5 100644
|
|
|
23f808 |
--- a/tests/test_ipa_certfile_expiration.py
|
|
|
23f808 |
+++ b/tests/test_ipa_certfile_expiration.py
|
|
|
23f808 |
@@ -24,8 +24,6 @@ class IPACertificate:
|
|
|
23f808 |
|
|
|
23f808 |
class TestIPACertificateFile(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipahealthcheck.ipa.certs.get_expected_requests':
|
|
|
23f808 |
Mock(return_value=get_expected_requests()),
|
|
|
23f808 |
'ipalib.install.certmonger._cm_dbus_object':
|
|
|
23f808 |
diff --git a/tests/test_ipa_certmonger_ca.py b/tests/test_ipa_certmonger_ca.py
|
|
|
23f808 |
index ac56a60..4eec1ba 100644
|
|
|
23f808 |
--- a/tests/test_ipa_certmonger_ca.py
|
|
|
23f808 |
+++ b/tests/test_ipa_certmonger_ca.py
|
|
|
23f808 |
@@ -12,8 +12,6 @@ from unittest.mock import Mock, patch
|
|
|
23f808 |
|
|
|
23f808 |
class TestCertmonger(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipaserver.install.cainstance.CAInstance':
|
|
|
23f808 |
Mock(return_value=CAInstance()),
|
|
|
23f808 |
}
|
|
|
23f808 |
diff --git a/tests/test_ipa_dna.py b/tests/test_ipa_dna.py
|
|
|
23f808 |
index 3d5dd3e..5450642 100644
|
|
|
23f808 |
--- a/tests/test_ipa_dna.py
|
|
|
23f808 |
+++ b/tests/test_ipa_dna.py
|
|
|
23f808 |
@@ -3,7 +3,7 @@
|
|
|
23f808 |
#
|
|
|
23f808 |
|
|
|
23f808 |
from base import BaseTest
|
|
|
23f808 |
-from unittest.mock import Mock, patch
|
|
|
23f808 |
+from unittest.mock import patch
|
|
|
23f808 |
from util import capture_results
|
|
|
23f808 |
|
|
|
23f808 |
from ipahealthcheck.core import config, constants
|
|
|
23f808 |
@@ -27,11 +27,6 @@ class mock_ReplicationManager:
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestDNARange(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
@patch('ipaserver.install.replication.ReplicationManager')
|
|
|
23f808 |
def test_dnarange_set(self, mock_manager):
|
|
|
23f808 |
mock_manager.return_value = mock_ReplicationManager(start=1, max=100)
|
|
|
23f808 |
diff --git a/tests/test_ipa_expiration.py b/tests/test_ipa_expiration.py
|
|
|
23f808 |
index f29f319..4c177f8 100644
|
|
|
23f808 |
--- a/tests/test_ipa_expiration.py
|
|
|
23f808 |
+++ b/tests/test_ipa_expiration.py
|
|
|
23f808 |
@@ -17,8 +17,6 @@ from datetime import datetime, timedelta, timezone
|
|
|
23f808 |
|
|
|
23f808 |
class TestExpiration(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipahealthcheck.ipa.certs.get_expected_requests':
|
|
|
23f808 |
Mock(return_value=get_expected_requests()),
|
|
|
23f808 |
'ipalib.install.certmonger._cm_dbus_object':
|
|
|
23f808 |
diff --git a/tests/test_ipa_nssdb.py b/tests/test_ipa_nssdb.py
|
|
|
23f808 |
index 67b9a55..7d5664e 100644
|
|
|
23f808 |
--- a/tests/test_ipa_nssdb.py
|
|
|
23f808 |
+++ b/tests/test_ipa_nssdb.py
|
|
|
23f808 |
@@ -28,8 +28,6 @@ def my_unparse_trust_flags(trust_flags):
|
|
|
23f808 |
|
|
|
23f808 |
class TestNSSDBTrust(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipaserver.install.cainstance.CAInstance':
|
|
|
23f808 |
Mock(return_value=CAInstance()),
|
|
|
23f808 |
'ipapython.certdb.unparse_trust_flags':
|
|
|
23f808 |
diff --git a/tests/test_ipa_nssvalidation.py b/tests/test_ipa_nssvalidation.py
|
|
|
23f808 |
index ba93ba5..1e567d8 100644
|
|
|
23f808 |
--- a/tests/test_ipa_nssvalidation.py
|
|
|
23f808 |
+++ b/tests/test_ipa_nssvalidation.py
|
|
|
23f808 |
@@ -19,8 +19,6 @@ class DsInstance:
|
|
|
23f808 |
|
|
|
23f808 |
class TestNSSValidation(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipahealthcheck.ipa.certs.get_dogtag_cert_password':
|
|
|
23f808 |
Mock(return_value='foo'),
|
|
|
23f808 |
'ipaserver.install.dsinstance.DsInstance':
|
|
|
23f808 |
diff --git a/tests/test_ipa_opensslvalidation.py b/tests/test_ipa_opensslvalidation.py
|
|
|
23f808 |
index 74751e3..0d334cd 100644
|
|
|
23f808 |
--- a/tests/test_ipa_opensslvalidation.py
|
|
|
23f808 |
+++ b/tests/test_ipa_opensslvalidation.py
|
|
|
23f808 |
@@ -14,8 +14,6 @@ from ipapython.ipautil import _RunResult
|
|
|
23f808 |
|
|
|
23f808 |
class TestOpenSSLValidation(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipaserver.install.cainstance.CAInstance':
|
|
|
23f808 |
Mock(return_value=CAInstance()),
|
|
|
23f808 |
}
|
|
|
23f808 |
diff --git a/tests/test_ipa_revocation.py b/tests/test_ipa_revocation.py
|
|
|
23f808 |
index 3d1ea84..39cf3e7 100644
|
|
|
23f808 |
--- a/tests/test_ipa_revocation.py
|
|
|
23f808 |
+++ b/tests/test_ipa_revocation.py
|
|
|
23f808 |
@@ -23,8 +23,6 @@ class IPACertificate:
|
|
|
23f808 |
|
|
|
23f808 |
class TestRevocation(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipaserver.install.certs.is_ipa_issued_cert':
|
|
|
23f808 |
Mock(return_value=True),
|
|
|
23f808 |
'ipalib.x509.load_certificate_from_file':
|
|
|
23f808 |
diff --git a/tests/test_ipa_roles.py b/tests/test_ipa_roles.py
|
|
|
23f808 |
index 35c7a1d..453db06 100644
|
|
|
23f808 |
--- a/tests/test_ipa_roles.py
|
|
|
23f808 |
+++ b/tests/test_ipa_roles.py
|
|
|
23f808 |
@@ -3,7 +3,7 @@
|
|
|
23f808 |
#
|
|
|
23f808 |
|
|
|
23f808 |
from base import BaseTest
|
|
|
23f808 |
-from unittest.mock import Mock, patch
|
|
|
23f808 |
+from unittest.mock import patch
|
|
|
23f808 |
from util import capture_results, CAInstance
|
|
|
23f808 |
from util import m_api
|
|
|
23f808 |
|
|
|
23f808 |
@@ -14,11 +14,6 @@ from ipahealthcheck.ipa.roles import (IPACRLManagerCheck,
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestCRLManagerRole(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
@patch('ipaserver.install.cainstance.CAInstance')
|
|
|
23f808 |
def test_not_crlmanager(self, mock_ca):
|
|
|
23f808 |
mock_ca.return_value = CAInstance(crlgen=False)
|
|
|
23f808 |
@@ -57,11 +52,6 @@ class TestCRLManagerRole(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestRenewalMaster(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
def test_renewal_master_not_set(self):
|
|
|
23f808 |
framework = object()
|
|
|
23f808 |
registry.initialize(framework)
|
|
|
23f808 |
diff --git a/tests/test_ipa_topology.py b/tests/test_ipa_topology.py
|
|
|
23f808 |
index ebf7657..a4ff6d9 100644
|
|
|
23f808 |
--- a/tests/test_ipa_topology.py
|
|
|
23f808 |
+++ b/tests/test_ipa_topology.py
|
|
|
23f808 |
@@ -5,7 +5,6 @@
|
|
|
23f808 |
from util import capture_results
|
|
|
23f808 |
from util import m_api
|
|
|
23f808 |
from base import BaseTest
|
|
|
23f808 |
-from unittest.mock import Mock
|
|
|
23f808 |
|
|
|
23f808 |
from ipahealthcheck.core import config, constants
|
|
|
23f808 |
from ipahealthcheck.ipa.plugin import registry
|
|
|
23f808 |
@@ -13,11 +12,6 @@ from ipahealthcheck.ipa.topology import IPATopologyDomainCheck
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestTopology(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
def test_topology_ok(self):
|
|
|
23f808 |
m_api.Command.topologysuffix_verify.side_effect = [
|
|
|
23f808 |
{
|
|
|
23f808 |
diff --git a/tests/test_ipa_tracking.py b/tests/test_ipa_tracking.py
|
|
|
23f808 |
index abcb9af..c40d8f4 100644
|
|
|
23f808 |
--- a/tests/test_ipa_tracking.py
|
|
|
23f808 |
+++ b/tests/test_ipa_tracking.py
|
|
|
23f808 |
@@ -15,8 +15,6 @@ from mock_certmonger import get_expected_requests, set_requests
|
|
|
23f808 |
|
|
|
23f808 |
class TestTracking(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ipahealthcheck.ipa.certs.get_expected_requests':
|
|
|
23f808 |
Mock(return_value=get_expected_requests()),
|
|
|
23f808 |
'ipalib.install.certmonger._cm_dbus_object':
|
|
|
23f808 |
diff --git a/tests/test_ipa_trust.py b/tests/test_ipa_trust.py
|
|
|
23f808 |
index 2dcc4b3..0a1d58c 100644
|
|
|
23f808 |
--- a/tests/test_ipa_trust.py
|
|
|
23f808 |
+++ b/tests/test_ipa_trust.py
|
|
|
23f808 |
@@ -102,11 +102,6 @@ class SSSDConfig():
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestTrustAgent(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
def test_no_trust_agent(self):
|
|
|
23f808 |
framework = object()
|
|
|
23f808 |
registry.initialize(framework)
|
|
|
23f808 |
@@ -182,11 +177,6 @@ class TestTrustAgent(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestTrustDomains(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
def test_no_trust_agent(self):
|
|
|
23f808 |
framework = object()
|
|
|
23f808 |
registry.initialize(framework)
|
|
|
23f808 |
@@ -371,11 +361,6 @@ class TestTrustDomains(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestTrustCatalog(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
def test_no_trust_agent(self):
|
|
|
23f808 |
framework = object()
|
|
|
23f808 |
registry.initialize(framework)
|
|
|
23f808 |
@@ -477,8 +462,6 @@ class TestTrustCatalog(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
class Testsidgen(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ldap.initialize':
|
|
|
23f808 |
Mock(return_value=mock_ldap_conn()),
|
|
|
23f808 |
}
|
|
|
23f808 |
@@ -562,8 +545,6 @@ class Testsidgen(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
class TestTrustAgentMember(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ldap.initialize':
|
|
|
23f808 |
Mock(return_value=mock_ldap_conn()),
|
|
|
23f808 |
}
|
|
|
23f808 |
@@ -642,8 +623,6 @@ class TestTrustAgentMember(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
class TestControllerPrincipal(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ldap.initialize':
|
|
|
23f808 |
Mock(return_value=mock_ldap_conn()),
|
|
|
23f808 |
}
|
|
|
23f808 |
@@ -724,8 +703,6 @@ class TestControllerPrincipal(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
class TestControllerService(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ldap.initialize':
|
|
|
23f808 |
Mock(return_value=mock_ldap_conn()),
|
|
|
23f808 |
}
|
|
|
23f808 |
@@ -798,8 +775,6 @@ class TestControllerService(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
class TestControllerGroupSID(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ldap.initialize':
|
|
|
23f808 |
Mock(return_value=mock_ldap_conn()),
|
|
|
23f808 |
}
|
|
|
23f808 |
@@ -877,8 +852,6 @@ class TestControllerGroupSID(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
class TestControllerConf(BaseTest):
|
|
|
23f808 |
patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
'ldap.initialize':
|
|
|
23f808 |
Mock(return_value=mock_ldap_conn()),
|
|
|
23f808 |
}
|
|
|
23f808 |
@@ -922,11 +895,6 @@ class TestControllerConf(BaseTest):
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestPackageCheck(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
def test_agent_with_package(self):
|
|
|
23f808 |
# Note that this test assumes the import is installed
|
|
|
23f808 |
framework = object()
|
|
|
23f808 |
diff --git a/tests/test_meta_services.py b/tests/test_meta_services.py
|
|
|
23f808 |
index 0cb8f03..6fbea13 100644
|
|
|
23f808 |
--- a/tests/test_meta_services.py
|
|
|
23f808 |
+++ b/tests/test_meta_services.py
|
|
|
23f808 |
@@ -7,15 +7,9 @@ from base import BaseTest
|
|
|
23f808 |
|
|
|
23f808 |
from ipahealthcheck.ipa.plugin import registry
|
|
|
23f808 |
from ipahealthcheck.meta.services import httpd
|
|
|
23f808 |
-from unittest.mock import Mock
|
|
|
23f808 |
|
|
|
23f808 |
|
|
|
23f808 |
class TestServices(BaseTest):
|
|
|
23f808 |
- patches = {
|
|
|
23f808 |
- 'ipaserver.install.installutils.check_server_configuration':
|
|
|
23f808 |
- Mock(return_value=None),
|
|
|
23f808 |
- }
|
|
|
23f808 |
-
|
|
|
23f808 |
def test_simple_service(self):
|
|
|
23f808 |
"""
|
|
|
23f808 |
Test a service. It was chosen at random.
|
|
|
23f808 |
--
|
|
|
23f808 |
2.20.1
|
|
|
23f808 |
|