Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Feb 14, 2024
1 parent a1795fc commit 40f5bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions jdaviz/configs/cubeviz/plugins/slice/tests/test_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_slice(cubeviz_helper, spectrum1d_cube):
# from the widget this logic is duplicated (to avoid sending logic through messages)
sl._on_value_updated({'new': '4.62e-07'})
assert sl.slice == 0
assert np.allclose(sl.wavelength, 4.62280007e-07)
assert np.allclose(sl.value, 4.62280007e-07)

# make sure that passing an invalid value from the UI would revert to the previous value
# JS strips invalid characters, but doesn't ensure its float-compatible
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_slice(cubeviz_helper, spectrum1d_cube):
assert sl.slice == 0

sl.vue_goto_last()
assert sl.slice == sl.max_value
assert sl.slice == sl.max_slice

sl.vue_play_next() # Should automatically wrap to beginning
assert sl.slice == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def slice_plugin(self):
@observe('wavelength_dependent', 'bg_wavelength_dependent')
def _wavelength_dependent_changed(self, *args):
if self.wavelength_dependent:
self.reference_wavelength = self.slice_plugin.wavelength
self.reference_wavelength = self.slice_plugin.value
else:
self.bg_wavelength_dependent = False
# NOTE: this can be redundant in the case where reference_wavelength changed and triggers
Expand Down

0 comments on commit 40f5bc1

Please sign in to comment.