From 2e738c249808eb7138b622a925018957d952c4cc Mon Sep 17 00:00:00 2001 From: Kaushik Malapati Date: Wed, 25 Oct 2023 14:07:49 -0700 Subject: [PATCH] TST: adding basic tpr test --- pcdsdevices/tests/test_tpr.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 pcdsdevices/tests/test_tpr.py diff --git a/pcdsdevices/tests/test_tpr.py b/pcdsdevices/tests/test_tpr.py new file mode 100644 index 00000000000..c65618c2a68 --- /dev/null +++ b/pcdsdevices/tests/test_tpr.py @@ -0,0 +1,22 @@ +import pytest +from ophyd.sim import make_fake_device + +from ..tpr import TprTrigger + + +@pytest.fixture(scope='function') +def fake_trigger(): + cls = make_fake_device(TprTrigger) + return cls('TST:TPR', channel=1, name='trig_a') + + +def test_enable(fake_trigger): + fake_trigger.enable() + assert fake_trigger.enable_cmd.get() == 1 + fake_trigger.disable() + assert fake_trigger.enable_cmd.get() == 0 + + +@pytest.mark.timeout(5) +def test_disconnected_trigger(): + TprTrigger('TST', channel=1, name='test')