TestModeOverrideMixin
This module implements testMode and test mode overrides as a mix-in class.
- ska_tango_base.test_mode_mixin.standard_test_mode(doc: str | None = None, **kwargs: Any) tuple[Signal[TestMode], attribute_from_signal][source]
Return a signal and attribute pair for the optional
testModeattribute.When
TestMode.TEST, the device substitutes its normal operating logic with testing/stub logic, which is useful for integration testing without real hardware. The returned tuple should be unpacked into class-level signal and attribute declarations, for example:_test_mode, testMode = standard_test_mode()
The attribute is writable and memorized. Override
docto provide a device-specific description.- Parameters:
doc – Optional override for the Tango attribute description.
kwargs – Additional keyword arguments forwarded to
attribute_from_signal().
- Returns:
A
(signal, attribute)tuple.
- class ska_tango_base.test_mode_mixin.TestModeOverrideMixin[source]
Add Test Mode Attribute Overrides to a Tango device.
When testMode is TEST, clients can override the value of attributes using the test_mode_overrides attribute.
- _test_mode: Signal[scm.TestMode]
Signal for the test mode of the device.
Values are emitted for this signal whenever a client successfully changes to the testMode attribute.
- testMode: attribute_from_signal
Test mode attribute of the device.
Either no test mode or an indication of the test mode.
- read_testMode() TestMode | tuple[TestMode, float, AttrQuality][source]
Read the test mode of the device.
Subclasses can override this to change the behaviour of the
testModeattribute.
- write_testMode(mode: TestMode) None[source]
Write the test mode of the device.
Subclasses can override this to change the behaviour of the
testModeattribute.
- is_test_mode_overrides_allowed(request_type: AttReqType) bool[source]
Control access to test_mode_overrides attribute.
Writes to the attribute are allowed only if test mode is active.
- Parameters:
request_type – Attribute request type
- Returns:
If in test mode