Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed from builder.aOut to builder.Action for commands #100

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/fastcs/transport/epics/ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,8 @@ def _create_and_link_command_pv(
async def wrapped_method(_: Any):
await method()

record = builder.aOut(
record = builder.Action(
f"{pv_prefix}:{pv_name}",
initial_value=0,
always_update=True,
on_update=wrapped_method,
)

Expand Down
8 changes: 2 additions & 6 deletions tests/transport/epics/test_ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ def test_ioc(mocker: MockerFixture, controller: Controller):
always_update=True,
on_update=mocker.ANY,
)
builder.aOut.assert_any_call(
f"{DEVICE}:Go", initial_value=0, always_update=True, on_update=mocker.ANY
)
builder.Action.assert_any_call(f"{DEVICE}:Go", on_update=mocker.ANY)

# Check info tags are added
add_pvi_info.assert_called_once_with(f"{DEVICE}:PVI")
Expand Down Expand Up @@ -443,10 +441,8 @@ def test_long_pv_names_discarded(mocker: MockerFixture):
assert not getattr(long_name_controller, long_command_name).fastcs_method.enabled

short_command_pv_name = "command_short_name".title().replace("_", "")
builder.aOut.assert_called_once_with(
builder.Action.assert_called_once_with(
f"{DEVICE}:{short_command_pv_name}",
initial_value=0,
always_update=True,
on_update=mocker.ANY,
)
with pytest.raises(AssertionError):
Expand Down
Loading