-
-
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.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import numpy as np | ||
|
||
from Orange.data import Table | ||
from Orange.widgets.tests.base import GuiTest | ||
from Orange.widgets.visualize.owscatterplot import OWScatterPlot | ||
|
||
|
||
class TestOWScatterPlot(GuiTest): | ||
def setUp(self): | ||
self.widget = self.create_widget(OWScatterPlot) | ||
self.data = Table("iris") | ||
|
||
def tearDown(self): | ||
self.widget.onDeleteWidget() | ||
|
||
def test_set_data(self): | ||
self.widget.set_data(self.data) | ||
self.assertEqual(self.widget.data, self.data) | ||
self.assertEqual(self.widget.subset_data, None) | ||
|
||
def test_subset_data(self): | ||
self.widget.set_subset_data(self.data[:30]) | ||
self.assertEqual(len(self.widget.subset_data), 30) | ||
self.assertEqual(self.widget.data, None) | ||
np.testing.assert_array_equal(self.widget.subset_data, self.data[:30]) | ||
|
||
def test_set_data_none(self): | ||
self.widget.set_data(None) | ||
self.assertEqual(self.widget.data, None) | ||
self.assertEqual(self.widget.subset_data, None) | ||
|
||
def test_subset_data_none(self): | ||
self.widget.set_subset_data(None) | ||
self.assertEqual(self.widget.subset_data, None) | ||
self.assertEqual(self.widget.data, None) |