def upload(path: Path) -> bool: """ Given a path to a zip folder to be uploaded """ log.info(path) patient_id, device_id, start, end = path.stem.split("-") checksum = Dmpy.checksum(path) start_wear = wear_time_in_ms(start) end_wear = wear_time_in_ms(end) payload = FileUploadPayload(path, patient_id, device_id, start_wear, end_wear, checksum) log.info(payload) return Dmpy().upload(payload)
def test_checksum_success(fake_file) -> None: result = Dmpy.checksum(fake_file) assert result == "a2dee47ba6268925da97750ab742baf67f02e2fb54ce23d499fb66a5b0222903"