Skip to content

Commit

Permalink
Add tests to cover case of missing tof in dimensions of bounds parame…
Browse files Browse the repository at this point in the history
…ter for tof_bounded_spectra and wavelength_bounded_spectra
  • Loading branch information
esmith1729 committed Nov 22, 2024
1 parent 80bba94 commit d4a6cf0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/devices/simpledae/test_reducers.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,3 +911,15 @@ async def test_monitor_normalizer_det_sum_wavelength_mon_sum_wavelength( # 3, 3
def test_tof_bounded_spectra_bounds_missing_or_too_many(data: list[float]):
with pytest.raises(expected_exception=ValueError, match="Should contain lower and upper bound"):
tof_bounded_spectra(sc.array(dims=["tof"], values=data, unit=sc.units.us))


def test_tof_bounded_spectra_missing_tof_in_bounds_dims():
with pytest.raises(expected_exception=ValueError):
tof_bounded_spectra(sc.array(dims=[""], values=[0], unit=sc.units.us))


def test_wavelength_bounded_spectra_missing_tof_in_bounds_dims():
with pytest.raises(expected_exception=ValueError):
wavelength_bounded_spectra(
bounds=sc.array(dims=[""], values=[0], unit=sc.units.us), beam_total=sc.scalar(value=0)
)

0 comments on commit d4a6cf0

Please sign in to comment.