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:443–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

441
442
443def test_does_not_coerce_int() -> None:
444 class Model(BaseModel):
445 bar: int
446
447 assert Model.construct(bar=1).bar == 1
448 assert Model.construct(bar=10.9).bar == 10.9
449 assert Model.construct(bar="19").bar == "19" # type: ignore[comparison-overlap]
450 assert Model.construct(bar=False).bar is False
451
452
453def test_int_to_float_safe_conversion() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected