openflexure-microscope-server/tests/mock_things/mock_autofocus.py
Julian Stirling ad838e8643 Apply suggestions from code review of branch split-scan-dir-operations
Co-authored-by: Beth Probert <beth_probert@outlook.com>
2025-06-30 17:25:58 +01:00

17 lines
588 B
Python

"""This testing submodule contains mock autofocus things.
These mocks are designed to be inserted as dependencies to give specific
functionality and returns.
The mocks do not subclass, and instead return very specific defined answers
to functions
"""
class MockAutoFocusThing:
# Counter for checking functions were called
mock_call_count = {"looping_autofocus": 0}
def looping_autofocus(self, dz: int = 2000, start: str = "centre") -> None: # noqa: ARG002
"""This function mocks autofocus with no return"""
self.mock_call_count["looping_autofocus"] += 1