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

Source from the content-addressed store, hash-verified

475
476
477def test_does_not_coerce_int() -> None:
478 class Model(BaseModel):
479 bar: int
480
481 assert Model.construct(bar=1).bar == 1
482 assert Model.construct(bar=10.9).bar == 10.9
483 assert Model.construct(bar="19").bar == "19" # type: ignore[comparison-overlap]
484 assert Model.construct(bar=False).bar is False
485
486
487def test_int_to_float_safe_conversion() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected