-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV/DOC: Specify lcls 1 or 2 timing in initializer, updated documenta…
…tion
- Loading branch information
Kaushik Malapati
authored and
Kaushik Malapati
committed
Oct 31, 2023
1 parent
2eceb5f
commit 03a1ba6
Showing
3 changed files
with
74 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import pytest | ||
from ophyd.sim import make_fake_device | ||
|
||
from ..tpr import TprTrigger | ||
from ..tpr import TimingMode, TprTrigger | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def fake_trigger(): | ||
cls = make_fake_device(TprTrigger) | ||
return cls('TST:TPR', channel=1, name='trig_a') | ||
return cls('TST:TPR', channel=10, timing_mode=TimingMode.LCLS2, name='trig_a') | ||
|
||
|
||
def test_enable(fake_trigger): | ||
fake_trigger.enable() | ||
assert fake_trigger.enable_cmd.get() == 1 | ||
assert fake_trigger.enable_ch_cmd.get() == 1 | ||
assert fake_trigger.enable_trg_cmd.get() == 1 | ||
fake_trigger.disable() | ||
assert fake_trigger.enable_cmd.get() == 0 | ||
assert fake_trigger.enable_ch_cmd.get() == 0 | ||
assert fake_trigger.enable_trg_cmd.get() == 0 | ||
|
||
|
||
@pytest.mark.timeout(5) | ||
def test_disconnected_trigger(): | ||
TprTrigger('TST', channel=1, name='test') | ||
TprTrigger('TST', channel=1, timing_mode=TimingMode.LCLS1, name='test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters