(criteria)
| 41 | |
| 42 | |
| 43 | def validate_criteria(criteria): |
| 44 | if not isinstance(criteria, dict): |
| 45 | raise ValueValidationException("Criteria should be a dict.") |
| 46 | |
| 47 | for key, value in six.iteritems(criteria): |
| 48 | operator = value.get("type", None) |
| 49 | if operator is None: |
| 50 | raise ValueValidationException("Operator not specified for field: " + key) |
| 51 | if operator not in allowed_operators: |
| 52 | raise ValueValidationException( |
| 53 | "For field: " |
| 54 | + key |
| 55 | + ", operator " |
| 56 | + operator |
| 57 | + " not in list of allowed operators: " |
| 58 | + str(list(allowed_operators.keys())) |
| 59 | ) |
| 60 | pattern = value.get("pattern", None) |
| 61 | if pattern is None: |
| 62 | raise ValueValidationException( |
| 63 | "For field: " |
| 64 | + key |
| 65 | + ", no pattern specified " |
| 66 | + "for operator " |
| 67 | + operator |
| 68 | ) |
| 69 | |
| 70 | |
| 71 | def validate_trigger_parameters(trigger_type_ref, parameters): |
nothing calls this directly
no test coverage detected