()
| 447 | |
| 448 | |
| 449 | def test_plugin_path_create_model() -> None: |
| 450 | class CustomOnValidatePython(ValidatePythonHandlerProtocol): |
| 451 | pass |
| 452 | |
| 453 | class Plugin: |
| 454 | def new_schema_validator(self, schema, schema_type, schema_type_path, schema_kind, config, plugin_settings): |
| 455 | assert schema_type.__name__ == 'FooModel' |
| 456 | assert list(schema_type.model_fields.keys()) == ['foo', 'bar'] |
| 457 | assert schema_type_path == SchemaTypePath('tests.test_plugins', 'FooModel') |
| 458 | assert schema_kind == 'create_model' |
| 459 | return CustomOnValidatePython(), None, None |
| 460 | |
| 461 | plugin = Plugin() |
| 462 | with install_plugin(plugin): |
| 463 | create_model('FooModel', foo=(str, ...), bar=(int, 123)) |
| 464 | |
| 465 | |
| 466 | def test_plugin_path_complex() -> None: |
nothing calls this directly
no test coverage detected