| 33 | |
| 34 | def test_on_validate_json_on_success() -> None: |
| 35 | class CustomOnValidateJson(ValidateJsonHandlerProtocol): |
| 36 | def on_enter( |
| 37 | self, |
| 38 | input: str | bytes | bytearray, |
| 39 | *, |
| 40 | strict: bool | None = None, |
| 41 | extra: ExtraValues | None = None, |
| 42 | context: Any | None = None, |
| 43 | self_instance: Any | None = None, |
| 44 | by_alias: bool | None = None, |
| 45 | by_name: bool | None = None, |
| 46 | ) -> None: |
| 47 | assert input == '{"a": 1}' |
| 48 | assert strict is None |
| 49 | assert extra is None |
| 50 | assert context is None |
| 51 | assert self_instance is None |
| 52 | |
| 53 | def on_success(self, result: Any) -> None: |
| 54 | assert isinstance(result, Model) |
| 55 | |
| 56 | class CustomPlugin(PydanticPluginProtocol): |
| 57 | def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings): |
no outgoing calls