Skip to content

Commit

Permalink
TST #984 with fake AD
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Aug 24, 2024
1 parent 70f9be5 commit b8faef6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apstools/devices/tests/test_issue984_ad_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Test the area detector factory class with an ophyd fake device.
.. see: https://github.com/BCDA-APS/apstools/issues/984#issuecomment-2195201893
"""
from ophyd.sim import instantiate_fake_device as make_fake

from ..area_detector_factory import ad_class_factory


def test_my_fake_area_detector():
ad_class = ad_class_factory("FakeAD", None, ["cam"])
fake_ad = make_fake(ad_class, prefix="Fake:AD", name="fake_ad")
assert "cam.acquire_time" not in fake_ad.stage_sigs

fake_ad.stage_sigs["cam.acquire_time"] = 2.0
fake_ad.stage()
assert fake_ad.cam.acquire_time.get() == 2.0

0 comments on commit b8faef6

Please sign in to comment.