Normalizes option names in the options dictionary by converting them to their internally-used names. :param options: Instance of _CaseInsensitiveDictionary containing MongoDB URI options.
(options: _CaseInsensitiveDictionary)
| 343 | |
| 344 | |
| 345 | def _normalize_options(options: _CaseInsensitiveDictionary) -> _CaseInsensitiveDictionary: |
| 346 | """Normalizes option names in the options dictionary by converting them to |
| 347 | their internally-used names. |
| 348 | |
| 349 | :param options: Instance of _CaseInsensitiveDictionary containing |
| 350 | MongoDB URI options. |
| 351 | """ |
| 352 | # Expand the tlsInsecure option. |
| 353 | tlsinsecure = options.get("tlsinsecure") |
| 354 | if tlsinsecure is not None: |
| 355 | for opt in _IMPLICIT_TLSINSECURE_OPTS: |
| 356 | # Implicit options are logically the same as tlsInsecure. |
| 357 | options[opt] = tlsinsecure |
| 358 | |
| 359 | for optname in list(options): |
| 360 | intname = INTERNAL_URI_OPTION_NAME_MAP.get(optname, None) |
| 361 | if intname is not None: |
| 362 | options[intname] = options.pop(optname) |
| 363 | |
| 364 | return options |
| 365 | |
| 366 | |
| 367 | def validate_options(opts: Mapping[str, Any], warn: bool = False) -> MutableMapping[str, Any]: |
no test coverage detected