source: orange/testing/unittests/tests/test_io.py @ 8136:718bda796fa3

Revision 8136:718bda796fa3, 763 bytes checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)

Added tests for distance measures, io, knn, rules, table and variable.
Fixed some other tests.

Line 
1import unittest
2import Orange
3from Orange.misc import testing
4import os, sys
5
6datasets = ["iris", "housing", ]
7
8def names_iter():
9    for n in datasets:
10        yield n, (n,)
11       
12@testing.data_driven(data_iter=names_iter())
13class TestIO(unittest.TestCase):
14#    def setUp(self):
15#        Orange.data.io.set_search_paths()
16    @testing.test_on_data
17    def test_io_on(self, name):
18        table = Orange.data.Table(name)
19        for ext in ["tab", "svm", "arff"]: # TODO: add R, and C50
20            filename = name + "." + ext
21            try:
22                table.save(filename)
23                table_clone = Orange.data.Table(filename)
24            finally:
25                os.remove(filename)
26               
27if __name__ == "__main__":
28    unittest.main()
Note: See TracBrowser for help on using the repository browser.