betty.assertions.record module¶
Key-value record data assertions.
- final class betty.assertions.record.Field¶
Bases:
GenericA key-value mapping field.
- betty.assertions.record.assert_record(*fields: Field[Any, Any], allow_extra: bool = False) Pipeline[Any, MutableMapping[str, Any]]¶
Assert that a value is a record: a key-value mapping of arbitrary value types, with a known structure.
To validate a key-value mapping as a records, assertions for all possible keys MUST be provided. Any keys present in the value for which no field assertions are provided will cause the entire record assertion to fail.