From fb7e522316ecd382152c0b0959ca23492005aca9 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 7 Jul 2023 10:15:52 -0400 Subject: [PATCH] PYTHON-3800 Add test for SRV URI with uppercase hostname (#1293) (cherry picked from commit 1d7f2ea1c805171403ba0b9f0971286f386391f4) --- test/test_dns.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test_dns.py b/test/test_dns.py index 352d05376..9312e37e0 100644 --- a/test/test_dns.py +++ b/test/test_dns.py @@ -21,7 +21,7 @@ import sys sys.path[0:0] = [""] -from test import client_context, unittest +from test import IntegrationTest, client_context, unittest from test.utils import wait_until from pymongo.common import validate_read_preference_tags @@ -186,5 +186,13 @@ class TestParsingErrors(unittest.TestCase): ) +class TestCaseInsensitive(IntegrationTest): + @unittest.skipUnless(_HAVE_DNSPYTHON, "DNS tests require the dnspython module") + def test_connect_case_insensitive(self): + client = MongoClient("mongodb+srv://TEST1.TEST.BUILD.10GEN.cc/") + self.addCleanup(client.close) + self.assertGreater(len(client.topology_description.server_descriptions()), 1) + + if __name__ == "__main__": unittest.main()