MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_validate_suggestion

Method test_validate_suggestion

test/test_client.py:595–601  ·  view source on GitHub ↗

Validate kwargs in constructor.

(self)

Source from the content-addressed store, hash-verified

593 self.assertIsInstance(c.options.retry_reads, bool)
594
595 def test_validate_suggestion(self):
596 """Validate kwargs in constructor."""
597 for typo in ["auth", "Auth", "AUTH"]:
598 expected = f"Unknown option: {typo}. Did you mean one of (authsource, authmechanism, authoidcallowedhosts) or maybe a camelCase version of one? Refer to docstring."
599 expected = re.escape(expected)
600 with self.assertRaisesRegex(ConfigurationError, expected):
601 MongoClient(**{typo: "standard"}) # type: ignore[arg-type]
602
603 @patch("pymongo.synchronous.srv_resolver._SrvResolver.get_hosts")
604 def test_detected_environment_logging(self, mock_get_hosts):

Callers

nothing calls this directly

Calls 1

MongoClientClass · 0.90

Tested by

no test coverage detected