MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_special_chars

Method test_special_chars

test/test_uri_parser.py:528–534  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

526 self.assertEqual(options, res["options"])
527
528 def test_special_chars(self):
529 user = "user@ /9+:?~!$&'()*+,;="
530 pwd = "pwd@ /9+:?~!$&'()*+,;="
531 uri = f"mongodb://{quote_plus(user)}:{quote_plus(pwd)}@localhost"
532 res = parse_uri(uri)
533 self.assertEqual(user, res["username"])
534 self.assertEqual(pwd, res["password"])
535
536 def test_do_not_include_password_in_port_message(self):
537 with self.assertRaisesRegex(ValueError, "Port must be an integer between 0 and 65535"):

Callers

nothing calls this directly

Calls 1

parse_uriFunction · 0.90

Tested by

no test coverage detected