9fdb4c931fc4bb3572891ffa569ec21ffe16911e,Orange/widgets/data/tests/test_oweditdomain.py,TestEditors,test_discrete_editor,#TestEditors#,223
Before Change
w = DiscreteVariableEditor()
self.assertIs(w.get_data(), None)
v = DiscreteVariable("C", values=["a", "b", "c"])
v.attributes.update({"A": 1, "B": "b"})
w.set_data(v)
self.assertEqual(w.name_edit.text(), v.name)
After Change
w = DiscreteVariableEditor()
self.assertEqual(w.get_data(), (None, []))
v = Categorical("C", ("a", "b", "c"), None,
(("A", "1"), ("B", "b")))
w.set_data(v)
self.assertEqual(w.name_edit.text(), v.name)
self.assertEqual(w.labels_model.get_dict(), dict(v.annotations))
self.assertEqual(w.get_data(), (v, []))
w.set_data(None)
self.assertEqual(w.name_edit.text(), "")
self.assertEqual(w.labels_model.get_dict(), {})
self.assertEqual(w.get_data(), (None, []))
mapping = [
("c", "C"),
("a", "A"),
("b", None),
(None, "b")
]
w.set_data(v, [CategoriesMapping(mapping)])
w.grab() // run delegate paint method
self.assertEqual(w.get_data(), (v, [CategoriesMapping(mapping)]))
// test selection/deselection in the view
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: biolab/orange3
Commit Name: 9fdb4c931fc4bb3572891ffa569ec21ffe16911e
Time: 2018-09-10
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/widgets/data/tests/test_oweditdomain.py
Class Name: TestEditors
Method Name: test_discrete_editor
Project Name: biolab/orange3
Commit Name: 9ddf444db01c3e6c1ecbb13320f793775632ec02
Time: 2017-01-20
Author: pavlin.g.p@gmail.com
File Name: Orange/widgets/classify/owrandomforest.py
Class Name:
Method Name:
Project Name: biolab/orange3
Commit Name: 9ddf444db01c3e6c1ecbb13320f793775632ec02
Time: 2017-01-20
Author: pavlin.g.p@gmail.com
File Name: Orange/widgets/regression/owrandomforestregression.py
Class Name:
Method Name: