-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1677 from VesnaT/annotated_data
[ENH] Visualize widgets: Output Annotated data and Fixups
- Loading branch information
Showing
24 changed files
with
304 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,37 @@ | ||
from Orange.data import Table | ||
# Test methods with long descriptive names can omit docstrings | ||
# pylint: disable=missing-docstring | ||
from Orange.widgets.data.owtable import OWDataTable | ||
from Orange.widgets.tests.base import WidgetTest | ||
from Orange.widgets.tests.base import WidgetTest, WidgetOutputsTestMixin | ||
|
||
|
||
class TestOWDataTable(WidgetTest): | ||
class TestOWDataTable(WidgetTest, WidgetOutputsTestMixin): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
WidgetOutputsTestMixin.init(cls) | ||
|
||
cls.signal_name = "Data" | ||
cls.signal_data = cls.data | ||
|
||
def setUp(self): | ||
self.widget = self.create_widget(OWDataTable) | ||
self.iris = Table("iris") | ||
|
||
def test_input_data(self): | ||
"""Check number of tabs with data on the input""" | ||
self.send_signal("Data", self.iris, 1) | ||
self.send_signal("Data", self.data, 1) | ||
self.assertEqual(self.widget.tabs.count(), 1) | ||
self.send_signal("Data", self.iris, 2) | ||
self.send_signal("Data", self.data, 2) | ||
self.assertEqual(self.widget.tabs.count(), 2) | ||
self.send_signal("Data", None, 1) | ||
self.assertEqual(self.widget.tabs.count(), 1) | ||
|
||
def test_data_model(self): | ||
self.send_signal("Data", self.iris, 1) | ||
self.assertEqual(self.widget.tabs.widget(0).model().rowCount(), len(self.iris)) | ||
self.send_signal("Data", self.data, 1) | ||
self.assertEqual(self.widget.tabs.widget(0).model().rowCount(), | ||
len(self.data)) | ||
|
||
def _select_data(self): | ||
self.widget.selected_cols = list(range(len(self.data.domain))) | ||
self.widget.selected_rows = list(range(0, len(self.data.domain), 10)) | ||
self.widget.set_selection() | ||
return self.widget.selected_rows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.