()
| 227 | |
| 228 | |
| 229 | def test_iso_timedelta_simple(): |
| 230 | class Model(BaseModel): |
| 231 | x: timedelta |
| 232 | |
| 233 | m = Model(x=123) |
| 234 | json_data = m.model_dump_json() |
| 235 | assert json_data == '{"x":"PT2M3S"}' |
| 236 | assert Model.model_validate_json(json_data).x == timedelta(seconds=123) |
| 237 | |
| 238 | |
| 239 | def test_con_decimal_encode() -> None: |
nothing calls this directly
no test coverage detected