Update tests/test_utils_hastyepics.py
Run CI Tests / test (push) Successful in 57s

This commit is contained in:
2025-08-03 19:34:41 +02:00
parent 4a769ef9f8
commit 5f09a4f023
+17
View File
@@ -58,11 +58,28 @@ def test_motor_init_list_has_no_disabled():
def test_motor_initializes_device_attrs():
# Check that Motor correctly initializes all Device PVs from _init_list
m = Motor("TEST:MOTOR")
# Debug prints
print("\n=== DEBUG INFO ===")
print("1. _init_list contents:", m._init_list)
print("2. All attributes on motor:", dir(m))
print("3. PV objects state:")
for attr in m._init_list:
print(f"\nChecking attribute: {attr}")
assert hasattr(m, attr), f"Motor is missing attribute: {attr}"
pv = getattr(m, attr)
# Additional PV debug info
print(f"PV object: {pv}")
if pv is not None:
print(f"PV name: {pv.pvname}")
print(f"PV connected: {pv.connected}")
assert isinstance(pv, epics.pv.PV), f"{attr} is not a valid PV object"
assert not pv.connected, f"{attr} should not be connected yet"
print("\n=== END DEBUG ===")
def test_motor_pv_connection_skipped_by_default():
# PVs should not be connected right after Motor creation