-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Description of the bug
When using tm_devices with Tektronix scopes (MSO64B.), the save_screenshot() API throws an AssertionError even though the instrument responds correctly.
Tek scopes return SAVE:IMAGE:COMPOSITION? → NORM, while the driver expects the literal string "NORMAL".
The mismatch arises in:
tm_devices/helpers/verification_functions.py
verify_values() → raise_error()
Expected behavior
The verification should treat NORM and NORMAL as equivalent, consistent with instrument SCPI responses.
Steps To Reproduce
from tm_devices import DeviceManager
with DeviceManager() as mgr:
scope = mgr.add_scope("TCPIP::192.168.1.100::INSTR")
scope.save_screenshot("example.png")
Environment Information
No response
Additional Information
Suggested fix
In verify_values(), normalize abbreviations before raising:
if isinstance(expected_value, str) and isinstance(actual_value, str):
exp = expected_value.strip().upper()
act = actual_value.strip().upper()
if act == exp or act.startswith(exp[:4]) or exp.startswith(act[:4]):
return True