MCPcopy Create free account
hub / github.com/cdgriffith/Box / cast_id

Method cast_id

test/test_box.py:1411–1414  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

1409 pass
1410
1411 def cast_id(val) -> int:
1412 if val == "bad_id":
1413 raise CustomError()
1414 return int(val)
1415
1416 b = Box(id="6", box_recast={"id": cast_id})
1417 assert isinstance(b.id, int)

Callers

nothing calls this directly

Calls 1

CustomErrorClass · 0.85

Tested by

no test coverage detected