Skip to content

Commit

Permalink
Merge pull request #1654 from VesnaT/boxplot_attrs
Browse files Browse the repository at this point in the history
[FIX] OWBoxPlot: Reset widget's appearance when data is removed
  • Loading branch information
astaric authored Oct 13, 2016
2 parents 0791308 + 9542456 commit c597742
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Orange/widgets/visualize/owboxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ def set_data(self, dataset):
def reset_all_data(self):
self.clear_scene()
self.infot1.setText("")
self.attrs[:] = []
self.group_vars[:] = []
self.is_continuous = False
self.update_display_box()

def attr_changed(self):
self.compute_box_data()
Expand Down
9 changes: 7 additions & 2 deletions Orange/widgets/visualize/tests/test_owboxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ def setUpClass(cls):
def setUp(self):
self.widget = self.create_widget(OWBoxPlot)

@skip("Known bug, FIXME!")
def test_input_data(self):
"""Check widget's data"""
self.send_signal("Data", self.iris)
self.assertGreater(len(self.widget.attrs), 0)
self.assertEqual(len(self.widget.attrs), 5)
self.assertEqual(len(self.widget.group_vars), 2)
self.assertFalse(self.widget.display_box.isHidden())
self.assertTrue(self.widget.stretching_box.isHidden())
self.send_signal("Data", None)
self.assertEqual(len(self.widget.attrs), 0)
self.assertEqual(len(self.widget.group_vars), 0)
self.assertTrue(self.widget.display_box.isHidden())
self.assertFalse(self.widget.stretching_box.isHidden())

def test_input_data_missings_cont_group_var(self):
"""Check widget with continuous data with missing values and group variable"""
Expand Down

0 comments on commit c597742

Please sign in to comment.