Skip to content

Commit

Permalink
TST #1218
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Oct 29, 2024
1 parent 895b5ac commit 6b409b9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ophyd/tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,26 +947,25 @@ class MyDevice(Device):


@pytest.mark.parametrize(
"before, after",
"initial, after",
[
[False, True, True],
[0, 1, True],
[0, 0, False],
["", "1!", True],
[False, True],
[0, 0],
["", "1!"],
],
)
def test_trigger_value(before, after):
def test_trigger_value(initial, after):
"""Ensure the configured trigger_value is used."""

class FakeTriggerableDevice(Device):
"""Common trigger signals expect value=1"""

strigger = Component(Signal, value=before, trigger_value=after)
strigger = Component(Signal, value=initial, trigger_value=after)

d = FakeTriggerableDevice("", name="test")
assert len(d.trigger_signals) == 1
assert [d.strigger] == d.trigger_signals
assert d.strigger.get() == before
assert d.strigger.get() == initial

d.trigger()
assert d.strigger.get() == after

0 comments on commit 6b409b9

Please sign in to comment.