Skip to content

Commit

Permalink
Update dialog tests to account for presence of new scatter export opt…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
Carifio24 committed Dec 6, 2024
1 parent bd04e87 commit 76deb80
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions glue_ar/common/tests/test_base_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def test_layer_change_state(self):
state = self.dialog.state

state.layer = "Scatter Data"
assert state.method_helper.choices == ["Scatter"]
assert state.method_helper.choices == ["Scatter", "Points"]
assert state.method == "Scatter"

state.layer = "Volume Data"
assert set(state.method_helper.choices) == {"Isosurface", "Voxel"}
assert state.method in {"Isosurface", "Voxel"}

state.layer = "Scatter Data"
assert state.method_helper.choices == ["Scatter"]
assert state.method_helper.choices == ["Scatter", "Points"]
assert state.method == "Scatter"

def test_method_settings_persistence(self):
Expand Down
10 changes: 8 additions & 2 deletions glue_ar/jupyter/tests/test_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ def test_layer_change_ui(self):

state.layer = "Scatter Data"
assert self.dialog.method_selected == 0
assert self.dialog.method_items == [{"text": "Scatter", "value": 0}]
assert self.dialog.method_items == [
{"text": "Scatter", "value": 0},
{"text": "Points", "value": 1},
]
assert not self.dialog.has_layer_options

state.layer = "Volume Data"
Expand All @@ -133,7 +136,10 @@ def test_layer_change_ui(self):

state.layer = "Scatter Data"
assert self.dialog.method_selected == 0
assert self.dialog.method_items == [{"text": "Scatter", "value": 0}]
assert self.dialog.method_items == [
{"text": "Scatter", "value": 0},
{"text": "Points", "value": 1},
]
assert not self.dialog.has_layer_options

def test_on_cancel(self):
Expand Down
12 changes: 6 additions & 6 deletions glue_ar/qt/tests/test_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ def test_layer_change_ui(self):

state.layer = "Scatter Data"
assert ui.combosel_method.currentText() == state.method
assert combobox_options(ui.combosel_method) == ["Scatter"]
assert not ui.label_method.isVisible()
assert not ui.combosel_method.isVisible()
assert combobox_options(ui.combosel_method) == ["Scatter", "Points"]
assert ui.label_method.isVisible()
assert ui.combosel_method.isVisible()

state.layer = "Volume Data"
assert set(combobox_options(ui.combosel_method)) == {"Isosurface", "Voxel"}
Expand All @@ -134,6 +134,6 @@ def test_layer_change_ui(self):

state.layer = "Scatter Data"
assert ui.combosel_method.currentText() == state.method
assert combobox_options(ui.combosel_method) == ["Scatter"]
assert not ui.label_method.isVisible()
assert not ui.combosel_method.isVisible()
assert combobox_options(ui.combosel_method) == ["Scatter", "Points"]
assert ui.label_method.isVisible()
assert ui.combosel_method.isVisible()

0 comments on commit 76deb80

Please sign in to comment.