Source

orange / Orange / testing / unit / tests / test_imputation.py

Full commit
from Orange.misc import testing
from Orange.misc.testing import datasets_driven, test_on_data
from Orange.feature.imputation import MaximalConstructor, \
									  MinimalConstructor, \
									  AverageConstructor
try:
	import unittest2 as unittest
except:
	import unittest

@datasets_driven(datasets=["/home/who/Orange-who/orange/Orange/doc/datasets/test-imputation"]) # Fix the import path
class TestImputation(testing.DataTestCase):

	def setUp(self):
		pass

	@test_on_data
	def test_minimal(self, dataset):
		imputer = MinimalConstructor(dataset)
		self.assertEquals(imputer(dataset[1])[2], 1)

	@test_on_data
	def test_maximal(self, dataset):
		imputer = MaximalConstructor(dataset)
		self.assertEquals(imputer(dataset[1])[2], 3)

	@test_on_data
	def test_average(self, dataset):
		imputer = AverageConstructor(dataset)
		self.assertEquals(imputer(dataset[1])[2], 2)

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