-
-
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
30 changed files
with
253 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Test methods with long descriptive names can omit docstrings | ||
# pylint: disable=missing-docstring | ||
import numpy as np | ||
|
||
from Orange.data import Table | ||
from Orange.widgets.data.owcontinuize import OWContinuize | ||
from Orange.widgets.tests.base import WidgetTest | ||
|
||
|
||
class TestOWContinuize(WidgetTest): | ||
def setUp(self): | ||
self.widget = self.create_widget(OWContinuize) | ||
|
||
def test_empty_data(self): | ||
"""No crash on empty data""" | ||
data = Table("iris") | ||
widget = self.widget | ||
widget.multinomial_treatment = 1 | ||
|
||
self.send_signal("Data", data) | ||
widget.unconditional_commit() | ||
imp_data = self.get_output("Data") | ||
np.testing.assert_equal(imp_data.X, data.X) | ||
np.testing.assert_equal(imp_data.Y, data.Y) | ||
|
||
widget.continuous_treatment = 1 | ||
self.send_signal("Data", Table(data.domain)) | ||
widget.unconditional_commit() | ||
imp_data = self.get_output("Data") | ||
self.assertEqual(len(imp_data), 0) | ||
|
||
self.send_signal("Data", None) | ||
widget.unconditional_commit() | ||
imp_data = self.get_output("Data") | ||
self.assertIsNone(imp_data) |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Test methods with long descriptive names can omit docstrings | ||
# pylint: disable=missing-docstring | ||
from Orange.data import Table | ||
from Orange.widgets.data.owdiscretize import OWDiscretize | ||
from Orange.widgets.tests.base import WidgetTest | ||
|
||
|
||
class TestOWDiscretize(WidgetTest): | ||
def setUp(self): | ||
self.widget = self.create_widget(OWDiscretize) | ||
|
||
def test_empty_data(self): | ||
"""No crash on empty data""" | ||
data = Table("iris") | ||
widget = self.widget | ||
widget.default_method = 3 | ||
self.send_signal("Data", Table(data.domain)) | ||
widget.unconditional_commit() |
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,30 @@ | ||
# Test methods with long descriptive names can omit docstrings | ||
# pylint: disable=missing-docstring | ||
import numpy as np | ||
|
||
from Orange.data import Table | ||
from Orange.widgets.data.owimpute import OWImpute | ||
from Orange.widgets.tests.base import WidgetTest | ||
|
||
|
||
class TestOWImpute(WidgetTest): | ||
def setUp(self): | ||
self.widget = self.create_widget(OWImpute) | ||
|
||
def test_empty_data(self): | ||
"""No crash on empty data""" | ||
data = Table("iris") | ||
widget = self.widget | ||
widget.default_method_index = widget.MODEL_BASED_IMPUTER | ||
widget.default_method = widget.METHODS[widget.default_method_index] | ||
|
||
self.send_signal("Data", data) | ||
widget.unconditional_commit() | ||
imp_data = self.get_output("Data") | ||
np.testing.assert_equal(imp_data.X, data.X) | ||
np.testing.assert_equal(imp_data.Y, data.Y) | ||
|
||
self.send_signal("Data", Table(data.domain)) | ||
widget.unconditional_commit() | ||
imp_data = self.get_output("Data") | ||
self.assertEqual(len(imp_data), 0) |
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,16 @@ | ||
# Test methods with long descriptive names can omit docstrings | ||
# pylint: disable=missing-docstring | ||
from Orange.data import Table | ||
from Orange.widgets.data.owpaintdata import OWPaintData | ||
from Orange.widgets.tests.base import WidgetTest | ||
|
||
|
||
class TestOWPaintData(WidgetTest): | ||
def setUp(self): | ||
self.widget = self.create_widget(OWPaintData) | ||
|
||
def test_empty_data(self): | ||
"""No crash on empty data""" | ||
data = Table("iris") | ||
self.send_signal("Data", data) | ||
self.send_signal("Data", Table(data.domain)) |
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.