Skip to content

Commit

Permalink
Fixed tests for the device list in Firefly.
Browse files Browse the repository at this point in the history
  • Loading branch information
canismarko committed Nov 8, 2023
1 parent c7655f7 commit 2041a1b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/haven/instrument/dxp.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ async def make_dxp_device(device_name, prefix, num_elements):
Cls,
prefix=f"{prefix}:",
name=device_name,
labels={"xrf_detectors", "fluorescence_detectors"},
labels={"xrf_detectors", "fluorescence_detectors", "detectors"},
)


Expand Down
2 changes: 1 addition & 1 deletion src/haven/instrument/xspress.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ async def make_xspress_device(name, prefix, num_elements):
Cls,
name=name,
prefix=f"{prefix}:",
labels={"xrf_detectors", "fluorescence_detectors"},
labels={"xrf_detectors", "fluorescence_detectors", "detectors"},
)


Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class DxpVortex(DxpDetector):
@pytest.fixture()
def dxp(sim_registry):
FakeDXP = make_fake_device(DxpVortex)
vortex = FakeDXP(name="vortex_me4", labels={"xrf_detectors"})
vortex = FakeDXP(name="vortex_me4", labels={"xrf_detectors", "detectors"})
sim_registry.register(vortex)
# vortex.net_cdf.dimensions.set([1477326, 1, 1])
yield vortex
Expand Down
4 changes: 2 additions & 2 deletions tests/test_detector_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from firefly.detector_list import DetectorListView


def test_detector_model(ffapp, sim_registry, sim_vortex):
def test_detector_model(ffapp, dxp):
view = DetectorListView()
assert hasattr(view, "detector_model")
assert view.detector_model.item(0).text() == "vortex_me4"


def test_selected_detectors(ffapp, sim_vortex, qtbot):
def test_selected_detectors(ffapp, dxp, qtbot):
"""Do we get the list of detectors after they have been selected?"""
# No detectors selected, so empty list
view = DetectorListView()
Expand Down

0 comments on commit 2041a1b

Please sign in to comment.