示例#1
0
 def test_show_distributions(self):
     w = self.widget
     data = Table("heart_disease")[::3].copy()
     self.send_signal(w.Inputs.data, data, 0)
     # run through the delegate paint routines
     with excepthook_catch():
         w.grab()
     w.controls.show_distributions.toggle()
     with excepthook_catch():
         w.grab()
     w.controls.color_by_class.toggle()
     with excepthook_catch():
         w.grab()
     w.controls.show_distributions.toggle()
示例#2
0
 def test_show_attribute_labels(self):
     w = self.widget
     self.send_signal(w.Inputs.data, self.data, 0)
     self.assertTrue(w.show_attribute_labels)  # default value
     with excepthook_catch():
         w.controls.show_attribute_labels.toggle()
     self.assertFalse(w.show_attribute_labels)
示例#3
0
 def test_whole_rows(self):
     w = self.widget
     self.send_signal(w.Inputs.data, self.data, 0)
     self.assertTrue(w.select_rows)  # default value
     with excepthook_catch():
         w.controls.select_rows.toggle()
     self.assertFalse(w.select_rows)
     w.selected_cols = [0, 1]
     w.selected_rows = [0, 1, 2, 3]
     w.set_selection()
     out = self.get_output(w.Outputs.selected_data)
     self.assertEqual(
         out.domain,
         Domain([self.data.domain.attributes[0]],
                self.data.domain.class_var))
     with excepthook_catch():
         w.controls.select_rows.toggle()
     out = self.get_output(w.Outputs.selected_data)
     self.assertTrue(w.select_rows)
     self.assertEqual(out.domain, self.data.domain)
 def test_kwargs_enabled_focus_out(self):
     # PyQt5's property via kwargs can invoke virtual overrides while still
     # not fully constructed
     with excepthook_catch(raise_on_exit=True):
         combobox.ComboBoxSearch(enabled=False)