()
| 56 | |
| 57 | |
| 58 | def test_bytes(): |
| 59 | s = SchemaValidator(core_schema.bytes_schema()) |
| 60 | assert s.validate_json('"foobar"') == b'foobar' |
| 61 | with pytest.raises(ValidationError, match=r'Input should be a valid bytes \[type=bytes_type,'): |
| 62 | s.validate_json('false') |
| 63 | with pytest.raises(ValidationError, match=r'Input should be a valid bytes \[type=bytes_type,'): |
| 64 | s.validate_json('123') |
| 65 | |
| 66 | |
| 67 | # A number well outside of i64 range |
nothing calls this directly
no test coverage detected