Skip to content

[BUG]: save_screenshot() fails verification: instrument returns NORM instead of NORMAL #513

@abnasim

Description

@abnasim

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCPIStandard Commands for Programmable InstrumentsbugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions