From a46331d478d68fca68bb9f85302fe411373f75b6 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Mon, 18 Mar 2024 16:22:35 -0700 Subject: [PATCH] PYTHON-4286 Remove duplicate test_detect_external_db (#1554) --- test/test_client.py | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/test/test_client.py b/test/test_client.py index 8f7fa6748..fb56f5057 100644 --- a/test/test_client.py +++ b/test/test_client.py @@ -102,9 +102,9 @@ from pymongo.errors import ( ServerSelectionTimeoutError, WriteConcernError, ) -from pymongo.mongo_client import MongoClient, _detect_external_db +from pymongo.mongo_client import MongoClient from pymongo.monitoring import ServerHeartbeatListener, ServerHeartbeatStartedEvent -from pymongo.pool import _METADATA, DOCKER_ENV_PATH, ENV_VAR_K8S, Connection, PoolOptions +from pymongo.pool import _METADATA, ENV_VAR_K8S, Connection, PoolOptions from pymongo.read_preferences import ReadPreference from pymongo.server_description import ServerDescription from pymongo.server_selectors import readable_server_selector, writable_server_selector @@ -597,34 +597,6 @@ class ClientUnitTest(unittest.TestCase): with self.assertWarns(UserWarning): MongoClient(multi_host) - def test_detect_external_db(self): - hosts = [ - "normalhost.com", - "host.cosmos.AZURE.com", - "host.docdb.amazonaws.com", - "host.docdb-elastic.amazonaws.com", - ] - with self.assertLogs("pymongo", level="INFO") as cm: - for host in hosts: - _detect_external_db(host) - logs = [record.message for record in cm.records if record.name == "pymongo.client"] - self.assertEqual(len(logs), 3) - self.assertEqual( - logs[0], - "You appear to be connected to a CosmosDB cluster. For more information regarding feature " - "compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb", - ) - self.assertEqual( - logs[1], - "You appear to be connected to a DocumentDB cluster. For more information regarding feature " - "compatibility and support please visit https://www.mongodb.com/supportability/documentdb", - ) - self.assertEqual( - logs[2], - "You appear to be connected to a DocumentDB cluster. For more information regarding feature " - "compatibility and support please visit https://www.mongodb.com/supportability/documentdb", - ) - class TestClient(IntegrationTest): def test_multiple_uris(self):