Convert JSON dict back to Patches.
(data: dict)
| 384 | |
| 385 | |
| 386 | def patches_from_json(data: dict) -> Patches: |
| 387 | """Convert JSON dict back to Patches.""" |
| 388 | return { |
| 389 | cls_name: { |
| 390 | test_name: [ |
| 391 | PatchSpec(**spec)._replace(ut_method=UtMethod(spec["ut_method"])) |
| 392 | for spec in specs |
| 393 | ] |
| 394 | for test_name, specs in tests.items() |
| 395 | } |
| 396 | for cls_name, tests in data.items() |
| 397 | } |