AssetBucket.satisfies#
- AssetBucket.satisfies(assets, constraints, violations=False)[source]
Checks whether the given asset satisfies the provided constraints.
Only functional assets that exist in both buckets are considered. If any key fails its individual satisfies check, it is treated as a violation.
- Parameters:
assets (dict[str, Any]) – The dictionary of asset values to evaluate.
constraints (dict[str, Any]) – The constraint values to satisfy.
violations (bool, optional) – If True, return a dictionary containing only the violated keys and their asset/constraint values. If False (default), return a boolean indicating overall satisfaction.
- Returns:
- If violations=False: True if all constraints are satisfied,
False otherwise.
- If violations=True: A dictionary of violations,
empty if all constraints pass.
- Return type:
bool | dict[str, dict[str, Any]]