Complete first pass (untested on hardware) of bg detect refactor.
This commit is contained in:
parent
2245d9357d
commit
fe1b84a922
10 changed files with 90 additions and 88 deletions
28
tests/mock_things/mock_camera.py
Normal file
28
tests/mock_things/mock_camera.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"""Testing submodule with mock Camera Things.
|
||||
|
||||
These mocks are designed to be inserted as dependencies to provide specific
|
||||
functionality and return values.
|
||||
|
||||
The mocks do not subclass Things. Instead, they return predefined
|
||||
answers to functions.
|
||||
"""
|
||||
|
||||
from openflexure_microscope_server.background_detect import (
|
||||
BackgroundDetectorStatus,
|
||||
ColourChannelDetectSettings,
|
||||
)
|
||||
|
||||
|
||||
class MockCameraThing:
|
||||
"""A mock background detect Thing that imports no code from BackgroundDetectThing.
|
||||
|
||||
The class needs functionality added to it over time as more complex
|
||||
mocking is needed. It imports no code from BackgroundDetectThing so that coverage
|
||||
is not artificially inflated.
|
||||
"""
|
||||
|
||||
background_detector_status = BackgroundDetectorStatus(
|
||||
ready=True,
|
||||
settings=ColourChannelDetectSettings(),
|
||||
settings_schema={"fake": "schema"},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue