From 1c4b608eca7b68735138e54c24fa472e60239926 Mon Sep 17 00:00:00 2001 From: Jeffrey 'Alex' Clark Date: Wed, 6 May 2026 16:59:52 -0400 Subject: [PATCH] Copilot review --- test/test_uri_parser.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test_uri_parser.py b/test/test_uri_parser.py index 0ddb95703..8781ee184 100644 --- a/test/test_uri_parser.py +++ b/test/test_uri_parser.py @@ -557,6 +557,11 @@ class TestURI(unittest.TestCase): with self.assertRaisesRegex(ValueError, r"Port contains whitespace character: '\\n'"): parse_uri("mongodb://localhost:27\n017") + def test_parse_uri_options_returns_dict(self): + # Regression: PYTHON-5421 changed the return type from + # _CaseInsensitiveDictionary to plain dict. + self.assertIsInstance(parse_uri("mongodb://localhost:27017")["options"], dict) + def test_unquoted_percent(self): self.assertFalse(_unquoted_percent("")) self.assertFalse(_unquoted_percent("no_percent_here")) @@ -615,8 +620,8 @@ class TestURI(unittest.TestCase): ) self.assertRaises(InvalidURI, split_options, "ssl=true&tls=false") self.assertRaises(InvalidURI, split_options, "ssl=false&tls=true") - self.assertTrue(split_options("ssl=true&tls=true")) - self.assertTrue(split_options("ssl=false&tls=false")) + self.assertEqual(split_options("ssl=true&tls=true"), {"tls": True}) + self.assertEqual(split_options("ssl=false&tls=false"), {"tls": False}) def test_split_options_mixed_delimiters(self): self.assertRaises(InvalidURI, split_options, "ssl=true&tls=true;appname=foo")