Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Nov 28, 2023
1 parent 17758cc commit 7aee6ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_markers_layer_cycle(self):
label_mouseover = self.imviz.app.session.application._tools['g-coords-info']

mp = self.imviz.plugins['Markers']
mp.plugin_opened = True
mp._obj.plugin_opened = True

# cycle through dataset options (used for both coords info and markers)
assert label_mouseover.dataset.choices == ['auto', 'none',
Expand Down Expand Up @@ -217,7 +217,7 @@ def test_markers_custom_viewer(self):
label_mouseover = self.imviz.app.session.application._tools['g-coords-info']

mp = self.imviz.plugins['Markers']
mp.plugin_opened = True
mp._obj.plugin_opened = True

nv = self.imviz.create_image_viewer()
self.imviz.app.add_data_to_viewer('imviz-1', 'has_wcs[SCI,1]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_custom_model_labels(specviz_helper, spectrum1d):

for i, model in enumerate(MODELS):
# Add one of each model with a unique name
modelfit_plugin.model_comp_selected = model
modelfit_plugin._obj.model_comp_selected = model
modelfit_plugin._obj.comp_label = f"test_model_{i}"
modelfit_plugin._obj.vue_add_model({})

Expand Down Expand Up @@ -159,7 +159,7 @@ def test_refit_plot_options(specviz_helper, spectrum1d):
specviz_helper.load_data(spectrum1d)
modelfit_plugin = specviz_helper.plugins['Model Fitting']

modelfit_plugin.model_comp_selected = 'Const1D'
modelfit_plugin._obj.model_comp_selected = 'Const1D'
modelfit_plugin._obj.comp_label = "C"
modelfit_plugin._obj.vue_add_model({})

Expand Down
6 changes: 3 additions & 3 deletions jdaviz/configs/imviz/tests/test_catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_plugin_no_image(self, imviz_helper):
self.imviz = imviz_helper

catalogs_plugin = self.imviz.app.get_tray_item_from_name('imviz-catalogs')
catalogs_plugin.plugin_opened = True
catalogs_plugin._obj.plugin_opened = True
# running the search without any data loaded into Imviz
catalogs_plugin.vue_do_search()

Expand All @@ -54,7 +54,7 @@ def test_plugin_image_no_result(self, imviz_helper, image_2d_wcs):
self.imviz = imviz_helper

catalogs_plugin = self.imviz.app.get_tray_item_from_name('imviz-catalogs')
catalogs_plugin.plugin_opened = True
catalogs_plugin._obj.plugin_opened = True
catalogs_plugin.vue_do_search()

# number of results should be 0
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_plugin_image_with_result(self, imviz_helper, tmp_path):
self.imviz = imviz_helper

catalogs_plugin = self.imviz.app.get_tray_item_from_name('imviz-catalogs')
catalogs_plugin.plugin_opened = True
catalogs_plugin._obj.plugin_opened = True
# This basically calls the following under the hood:
# skycoord_center = SkyCoord(6.62754354, 1.54466139, unit="deg")
# zoom_radius = r_max = 3 * u.arcmin
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/configs/imviz/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_blink(imviz_helper):

def test_compass_open_while_load(imviz_helper):
plg = imviz_helper.plugins['Compass']
plg.plugin_opened = True
plg._obj.plugin_opened = True

# Should not crash even if Compass is open in tray.
imviz_helper.load_data(np.ones((2, 2)))
Expand Down

0 comments on commit 7aee6ec

Please sign in to comment.