()
| 5998 | |
| 5999 | |
| 6000 | def test_chain_schema(): |
| 6001 | # this is a contrived schema which requires a string input that can be coerced to an int: |
| 6002 | s = core_schema.chain_schema([core_schema.str_schema(), core_schema.int_schema()]) |
| 6003 | assert SchemaValidator(s).validate_python('1') == 1 # proof it works this way |
| 6004 | |
| 6005 | assert GenerateJsonSchema().generate(s, mode='validation') == {'type': 'string'} |
| 6006 | assert GenerateJsonSchema().generate(s, mode='serialization') == {'type': 'integer'} |
| 6007 | |
| 6008 | |
| 6009 | def test_deferred_json_schema(): |
nothing calls this directly
no test coverage detected