Skip to content

Commit a9bae8e

Browse files
author
Axel Hörteborn
committed
fixed failing tests
1 parent ca7a474 commit a9bae8e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/test_j_create_guide_file.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@
88
def test_create_guide_file(gdf: GeoDataFarm):
99
clean_up()
1010
gdf.create_guide()
11+
# Select the field first so the attribute list is filtered to tables linked
12+
# to this field. Without filtering, stale tables left in the shared
13+
# database from earlier runs may land at row 0 with no numeric columns,
14+
# making cellWidget(0, 1) return None.
15+
idx = gdf.guide.CGF.CBFields.findText('test_field')
16+
gdf.guide.CGF.CBFields.setCurrentIndex(idx)
1117
gdf.guide.possible_attr('plant')
18+
# TWColumnNames row 0, column 1 is the QComboBox listing numeric attributes
19+
# of the first available plant table. setCurrentIndex(2) picks the third
20+
# attribute alphabetically (index 2) before it is added to the selected list.
1221
widget = gdf.guide.CGF.TWColumnNames.cellWidget(0, 1)
1322
widget.setCurrentIndex(2)
14-
gdf.guide.add_to_param_list(2, 0)
15-
gdf.guide.add_to_param_list(3, 0)
23+
gdf.guide.add_to_param_list(2, 0) # add attribute at combo-index 2, table row 0
24+
gdf.guide.add_to_param_list(3, 0) # add attribute at combo-index 3, table row 0
1625
gdf.guide.CGF.TWSelected.selectRow(1)
1726
gdf.guide.remove_from_param_list()
18-
idx = gdf.guide.CGF.CBFields.findText('test_field')
19-
gdf.guide.CGF.CBFields.setCurrentIndex(idx)
2027
gdf.guide.update_max_min()
2128
gdf.guide.set_output_path()
2229
gdf.guide.create_file()

0 commit comments

Comments
 (0)