Skip to content

Commit

Permalink
trigger readable dev test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilchreis committed Oct 18, 2024
1 parent 3cf1a9e commit 8743a9e
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tests/test_Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import xprocess
from ophyd_async.core import SignalR, observe_value
from ophyd_async.core import AsyncStatus, SignalR, observe_value
from xprocess import ProcessStarter, XProcessInfo

from secop_ophyd.SECoPDevices import SECoPMoveableDevice, SECoPNodeDevice
Expand Down Expand Up @@ -106,6 +106,32 @@ async def test_status(cryo_sim, cryo_node_internal_loop: SECoPNodeDevice):
await cryo_node_internal_loop.disconnect_async()


async def test_trigger(cryo_sim, cryo_node_internal_loop: SECoPNodeDevice):
# Node device has no read value, it has to return an empty dict
cryo_dev: SECoPMoveableDevice = cryo_node_internal_loop.cryo

val_old = await cryo_dev.read()

val_cached = await cryo_dev.read()

assert (
val_old[cryo_dev.value.name]["value"]
== val_cached[cryo_dev.value.name]["value"]
)

stat: AsyncStatus = cryo_dev.trigger()

await stat

val_new = await cryo_dev.read()

assert (
val_old[cryo_dev.value.name]["value"] != val_new[cryo_dev.value.name]["value"]
)

await cryo_node_internal_loop.disconnect_async()


# async def test_node_read_config(cryo_sim,cryo_node:SECoP_Node_Device):
# # Node device has no read value, it has to return an empty dict
# val_desc = await cryo_node.read_configuration()
Expand Down

0 comments on commit 8743a9e

Please sign in to comment.