Skip to content

Commit

Permalink
Some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrejaKovacic committed May 12, 2020
1 parent 1de92ce commit 3efcb43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Orange/widgets/evaluate/tests/test_owpredictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from Orange.data import Table, Domain, DiscreteVariable
from Orange.modelling import ConstantLearner, TreeLearner
from Orange.evaluation import Results
from Orange.widgets.tests.utils import excepthook_catch, possible_duplicate_table
from Orange.widgets.tests.utils import excepthook_catch, \
possible_duplicate_table
from Orange.widgets.utils.colorpalette import ColorPaletteGenerator


Expand Down Expand Up @@ -421,7 +422,6 @@ def test_unique_output_domain(self):
self.send_signal(self.widget.Inputs.predictors, predictor)

output = self.get_output(self.widget.Outputs.predictions)
print(output.domain)
self.assertEqual(output.domain.metas[0].name, 'constant (1)')


Expand Down
10 changes: 10 additions & 0 deletions Orange/widgets/visualize/tests/test_owsilhouetteplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME
from Orange.widgets.visualize.owsilhouetteplot import OWSilhouettePlot
from Orange.widgets.tests.base import WidgetTest, WidgetOutputsTestMixin
from Orange.widgets.tests.utils import possible_duplicate_table
from Orange.widgets.utils.state_summary import format_summary_details


Expand Down Expand Up @@ -252,6 +253,15 @@ def test_summary(self):
self.assertEqual(info._StateInfo__output_summary.brief, "")
self.assertEqual(info._StateInfo__output_summary.details, no_output)

def test_unique_output_domain(self):
widget = self.widget
data = possible_duplicate_table('Silhouette (iris)')
matrix = Orange.distance.Euclidean(data)
self.send_signal(widget.Inputs.data, matrix, widget=widget)

output = self.get_output(self.widget.Outputs.annotated_data)
self.assertEqual(output.domain.metas[0].name, 'Silhouette (iris) (1)')


if __name__ == "__main__":
unittest.main()

0 comments on commit 3efcb43

Please sign in to comment.