Serializes a Result object to a file as JSON. Args: result: A Result object containing results of an update job. result_file: File handle to which to serialize the result object.
(result, result_file)
| 44 | |
| 45 | |
| 46 | def write(result, result_file): |
| 47 | """Serializes a Result object to a file as JSON. |
| 48 | |
| 49 | Args: |
| 50 | result: A Result object containing results of an update job. |
| 51 | result_file: File handle to which to serialize the result object. |
| 52 | """ |
| 53 | json.dump(dataclasses.asdict(result), result_file, cls=_ResultEncoder) |
| 54 | |
| 55 | |
| 56 | class _ResultEncoder(json.JSONEncoder): |
nothing calls this directly
no outgoing calls
no test coverage detected