Skip to content

Commit

Permalink
Fixed tests to account for updates for changes to transform select view
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed Dec 17, 2024
1 parent f766fdb commit c713371
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/test_transform_select_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,26 @@ def test_transform_select_view(transform_select_view, qtbot):
transform_select_view.horizontalHeaderItem(1).text() == "Default File"
)

assert transform_select_view.rowCount() == len(
transform_select_view.transform_type_options
# At initialisation only affine and bspline transforms are shown
assert (
transform_select_view.rowCount()
== len(transform_select_view.transform_type_options) - 1
)
assert transform_select_view.columnCount() == 2

for i in range(len(transform_select_view.transform_type_options) - 1):
# At initialisation affine and bspline transforms are shown
# with ara_tools as the default file
for i in range(len(transform_select_view.transform_type_options) - 2):
assert (
transform_select_view.cellWidget(i, 0).currentText()
== transform_select_view.transform_type_options[i + 1]
== transform_select_view.transform_type_options[i + 2]
)
assert (
transform_select_view.cellWidget(i, 1).currentText()
== transform_select_view.file_options[0]
== transform_select_view.file_options[1]
)

last_row = len(transform_select_view.transform_type_options) - 1
last_row = len(transform_select_view.transform_type_options) - 2

assert (
transform_select_view.cellWidget(last_row, 0).currentText()
Expand Down Expand Up @@ -161,7 +165,8 @@ def test_file_option_default_on_transform_change(transform_select_view, qtbot):
== transform_select_view.file_options[file_option_index]
)

transform_select_view.cellWidget(0, 0).setCurrentIndex(2)
# Change the transform type from affine to rigid
transform_select_view.cellWidget(0, 0).setCurrentIndex(1)

assert (
transform_select_view.cellWidget(0, 1).currentText()
Expand Down

0 comments on commit c713371

Please sign in to comment.