Skip to content

Commit 1c4b608

Browse files
committed
Copilot review
1 parent ee4cb49 commit 1c4b608

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

test/test_uri_parser.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,11 @@ def test_port_with_whitespace(self):
557557
with self.assertRaisesRegex(ValueError, r"Port contains whitespace character: '\\n'"):
558558
parse_uri("mongodb://localhost:27\n017")
559559

560+
def test_parse_uri_options_returns_dict(self):
561+
# Regression: PYTHON-5421 changed the return type from
562+
# _CaseInsensitiveDictionary to plain dict.
563+
self.assertIsInstance(parse_uri("mongodb://localhost:27017")["options"], dict)
564+
560565
def test_unquoted_percent(self):
561566
self.assertFalse(_unquoted_percent(""))
562567
self.assertFalse(_unquoted_percent("no_percent_here"))
@@ -615,8 +620,8 @@ def test_tls_option_conflicts(self):
615620
)
616621
self.assertRaises(InvalidURI, split_options, "ssl=true&tls=false")
617622
self.assertRaises(InvalidURI, split_options, "ssl=false&tls=true")
618-
self.assertTrue(split_options("ssl=true&tls=true"))
619-
self.assertTrue(split_options("ssl=false&tls=false"))
623+
self.assertEqual(split_options("ssl=true&tls=true"), {"tls": True})
624+
self.assertEqual(split_options("ssl=false&tls=false"), {"tls": False})
620625

621626
def test_split_options_mixed_delimiters(self):
622627
self.assertRaises(InvalidURI, split_options, "ssl=true&tls=true;appname=foo")

0 commit comments

Comments
 (0)