Validates that 'value' is a list or a document.
(option: Any, value: Any)
| 524 | |
| 525 | |
| 526 | def validate_list_or_mapping(option: Any, value: Any) -> None: |
| 527 | """Validates that 'value' is a list or a document.""" |
| 528 | if not isinstance(value, (abc.Mapping, list)): |
| 529 | raise TypeError( |
| 530 | f"{option} must either be a list or an instance of dict, " |
| 531 | "bson.son.SON, or any other type that inherits from " |
| 532 | "collections.Mapping" |
| 533 | ) |
| 534 | |
| 535 | |
| 536 | def validate_is_mapping(option: str, value: Any) -> None: |
no outgoing calls
no test coverage detected