Update unit tests for new cancel behaviour
This commit is contained in:
parent
26a2e1a582
commit
d25ebabc77
2 changed files with 16 additions and 8 deletions
|
|
@ -351,10 +351,16 @@ class SmartScanThing(OFMThing):
|
|||
finally:
|
||||
# Save some final details but not set to the base model until after
|
||||
# resetting valued and unlocking just in case somehow pydantic errors.
|
||||
if self._scan_data is not None:
|
||||
final_image_count = self._scan_data.image_count
|
||||
if self._preview_stitcher is not None:
|
||||
last_timestamp = self.latest_preview_stitch_time
|
||||
|
||||
final_image_count = (
|
||||
self._scan_data.image_count if self._scan_data is not None else None
|
||||
)
|
||||
last_timestamp = (
|
||||
self.latest_preview_stitch_time
|
||||
if self._preview_stitcher is not None
|
||||
else None
|
||||
)
|
||||
|
||||
# However the scan finishes, unset all variables and release lock
|
||||
self._ongoing_scan = None
|
||||
self._scan_data = None
|
||||
|
|
@ -364,8 +370,10 @@ class SmartScanThing(OFMThing):
|
|||
|
||||
# Set the final details so they persist until the next scan
|
||||
if self._latest_scan_live_details is not None:
|
||||
self._latest_scan_live_details.image_count = final_image_count
|
||||
self._latest_scan_live_details.stitch_timestamp = last_timestamp
|
||||
if final_image_count is not None:
|
||||
self._latest_scan_live_details.image_count = final_image_count
|
||||
if last_timestamp is not None:
|
||||
self._latest_scan_live_details.stitch_timestamp = last_timestamp
|
||||
self._latest_scan_live_details.scan_phase = "Complete"
|
||||
|
||||
# Remove any scan folders containing zero images.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue