This validation is for security and internal debugging, not for users, so the messages are not intended to be clear. `output` comes from the callback definition, `output_spec` from the request.
(output, output_spec, Output)
| 118 | |
| 119 | |
| 120 | def validate_output_spec(output, output_spec, Output): |
| 121 | """ |
| 122 | This validation is for security and internal debugging, not for users, |
| 123 | so the messages are not intended to be clear. |
| 124 | `output` comes from the callback definition, `output_spec` from the request. |
| 125 | """ |
| 126 | if not isinstance(output, (list, tuple)): |
| 127 | output, output_spec = [output], [output_spec] |
| 128 | elif len(output) != len(output_spec): |
| 129 | raise exceptions.CallbackException("Wrong length output_spec") |
| 130 | |
| 131 | for outi, speci in zip(output, output_spec): |
| 132 | speci_list = speci if isinstance(speci, (list, tuple)) else [speci] |
| 133 | for specij in speci_list: |
| 134 | if ( |
| 135 | not Output(specij["id"], clean_property_name(specij["property"])) |
| 136 | == outi |
| 137 | ): |
| 138 | raise exceptions.CallbackException( |
| 139 | "Output does not match callback definition" |
| 140 | ) |
| 141 | |
| 142 | |
| 143 | def validate_and_group_input_args(flat_args, arg_index_grouping): |
nothing calls this directly
no test coverage detected
searching dependent graphs…