More complete testing of code that runs stitching subprocess.
This commit is contained in:
parent
cf74ea1351
commit
d7a7ac4c7d
5 changed files with 126 additions and 37 deletions
|
|
@ -11,18 +11,24 @@ from openflexure_microscope_server.background_detect import (
|
|||
BackgroundDetectorStatus,
|
||||
ColourChannelDetectSettings,
|
||||
)
|
||||
from unittest.mock import Mock, PropertyMock
|
||||
|
||||
|
||||
class MockCameraThing:
|
||||
class MockCameraThing(Mock):
|
||||
"""A mock camera Thing that imports no code from ``BaseCamera``.
|
||||
|
||||
The class needs functionality added to it over time as more complex
|
||||
mocking is needed. It imports no code from ``BaseCamera or any other
|
||||
mocking is needed. It imports no code from ``BaseCamera`` or any other
|
||||
camera Thing, so that coverage is not artificially inflated.
|
||||
"""
|
||||
|
||||
background_detector_status = BackgroundDetectorStatus(
|
||||
ready=True,
|
||||
settings=ColourChannelDetectSettings().model_dump(),
|
||||
settings_schema={"fake": "schema"},
|
||||
)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.background_detector_status = PropertyMock(
|
||||
return_value=BackgroundDetectorStatus(
|
||||
ready=True,
|
||||
settings=ColourChannelDetectSettings().model_dump(),
|
||||
settings_schema={"fake": "schema"},
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue