MCPcopy
hub / github.com/pydantic/pydantic / test_bool

Function test_bool

pydantic-core/tests/test_json.py:28–30  ·  view source on GitHub ↗
(input_value, output_value)

Source from the content-addressed store, hash-verified

26 [('false', False), ('true', True), ('0', False), ('1', True), ('"yes"', True), ('"no"', False)],
27)
28def test_bool(input_value, output_value):
29 v = SchemaValidator(core_schema.bool_schema())
30 assert v.validate_json(input_value) == output_value
31
32
33@pytest.mark.parametrize('input_value', ['[1, 2, 3]', b'[1, 2, 3]', bytearray(b'[1, 2, 3]')])

Callers

nothing calls this directly

Calls 2

bool_schemaMethod · 0.80
validate_jsonMethod · 0.45

Tested by

no test coverage detected