MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_does_not_coerce_int

Function test_does_not_coerce_int

tests/test_models.py:458–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

456
457
458def test_does_not_coerce_int() -> None:
459 class Model(BaseModel):
460 bar: int
461
462 assert Model.construct(bar=1).bar == 1
463 assert Model.construct(bar=10.9).bar == 10.9
464 assert Model.construct(bar="19").bar == "19" # type: ignore[comparison-overlap]
465 assert Model.construct(bar=False).bar is False
466
467
468def test_int_to_float_safe_conversion() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected