Skip to content

Commit

Permalink
VizRankDialog: Support execution of multiple widgets at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Jul 31, 2018
1 parent e5a383f commit 937be50
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions orangecontrib/prototypes/widgets/tests/test_owcorrelations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
import time
from Orange.data import Table
from Orange.widgets.visualize.owscatterplot import OWScatterPlot
from Orange.widgets.tests.base import WidgetTest
Expand All @@ -22,6 +23,7 @@ def setUp(self):
def test_input_data_cont(self):
"""Check correlation table for dataset with continuous attributes"""
self.send_signal("Data", self.data_cont)
time.sleep(0.1)
n_attrs = len(self.data_cont.domain.attributes)
self.assertEqual(self.widget.vizrank.rank_model.columnCount(), 2)
self.assertEqual(self.widget.vizrank.rank_model.rowCount(),
Expand All @@ -43,6 +45,7 @@ def test_input_data_mixed(self):
self.send_signal("Data", self.data_mixed)
domain = self.data_mixed.domain
n_attrs = len([a for a in domain.attributes if a.is_continuous])
time.sleep(0.1)
self.assertEqual(self.widget.vizrank.rank_model.columnCount(), 2)
self.assertEqual(self.widget.vizrank.rank_model.rowCount(),
n_attrs * (n_attrs - 1) / 2)
Expand All @@ -66,18 +69,25 @@ def test_input_data_one_instance(self):
def test_output_data(self):
"""Check dataset on output"""
self.send_signal("Data", self.data_cont)
time.sleep(0.1)
self.widget.commit()
self.assertEqual(self.data_cont, self.get_output("Data"))

def test_output_features(self):
"""Check features on output"""
self.send_signal("Data", self.data_cont)
time.sleep(0.1)
attrs = self.widget.cont_data.domain.attributes
self.widget._vizrank_selection_changed(attrs[0], attrs[1])
features = self.get_output("Features")
self.assertIsInstance(features, AttributeList)
self.assertEqual(len(features), 2)

def test_output_correlations(self):
"""Check correlation table on on output"""
self.send_signal("Data", self.data_cont)
time.sleep(0.1)
self.widget.commit()
correlations = self.get_output("Correlations")
self.assertIsInstance(correlations, Table)
self.assertEqual(len(correlations), 6)
Expand Down

0 comments on commit 937be50

Please sign in to comment.