def test_group_less_frequent_rel(self): dialog = GroupItemsDialog(self.v, self.data, ["a", "b"], {}) dialog.frequent_rel_radio.setChecked(True) dialog.frequent_rel_spin.setValue(50) dialog.new_name_line_edit.setText("BA") self.assertListEqual(dialog.get_merge_attributes(), ["b", "c"]) self.assertEqual(dialog.get_merged_value_name(), "BA") dialog.frequent_rel_spin.setValue(20) self.assertListEqual(dialog.get_merge_attributes(), ["c"]) dialog.frequent_rel_spin.setValue(15) self.assertListEqual(dialog.get_merge_attributes(), [])
def test_group_keep_n(self): dialog = GroupItemsDialog(self.v, self.data, ["a", "b"], {}) dialog.n_values_radio.setChecked(True) dialog.n_values_spin.setValue(1) dialog.new_name_line_edit.setText("BA") self.assertListEqual(dialog.get_merge_attributes(), ["b", "c"]) self.assertEqual(dialog.get_merged_value_name(), "BA") dialog.n_values_spin.setValue(2) self.assertListEqual(dialog.get_merge_attributes(), ["c"]) dialog.n_values_spin.setValue(3) self.assertListEqual(dialog.get_merge_attributes(), [])
def test_group_selected(self): dialog = GroupItemsDialog(self.v, self.data, ["a", "b"], {}) dialog.selected_radio.setChecked(True) dialog.new_name_line_edit.setText("BA") self.assertListEqual(dialog.get_merge_attributes(), ["a", "b"]) self.assertEqual(dialog.get_merged_value_name(), "BA")