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

Method cast_id

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

Source from the content-addressed store, hash-verified

1344 pass
1345
1346 def cast_id(val) -> int:
1347 if val == "bad_id":
1348 raise CustomError()
1349 return int(val)
1350
1351 b = Box(id="6", box_recast={"id": cast_id})
1352 assert isinstance(b.id, int)

Callers

nothing calls this directly

Calls 1

CustomErrorClass · 0.85

Tested by

no test coverage detected