(settings_dict)
| 327 | raise ConnectionFailure(msg) |
| 328 | |
| 329 | def _clean_settings(settings_dict): |
| 330 | if PYMONGO_VERSION < (4,): |
| 331 | irrelevant_fields_set = { |
| 332 | "name", |
| 333 | "username", |
| 334 | "password", |
| 335 | "authentication_source", |
| 336 | "authentication_mechanism", |
| 337 | "authmechanismproperties", |
| 338 | } |
| 339 | rename_fields = {} |
| 340 | else: |
| 341 | irrelevant_fields_set = {"name"} |
| 342 | rename_fields = { |
| 343 | "authentication_source": "authSource", |
| 344 | "authentication_mechanism": "authMechanism", |
| 345 | } |
| 346 | return { |
| 347 | rename_fields.get(k, k): v |
| 348 | for k, v in settings_dict.items() |
| 349 | if k not in irrelevant_fields_set and v is not None |
| 350 | } |
| 351 | |
| 352 | raw_conn_settings = _connection_settings[alias].copy() |
| 353 |
no test coverage detected