source: orange/Orange/testing/unit/tests/test_io.py @ 10651:4f6fcf57db06

Revision 10651:4f6fcf57db06, 791 bytes checked in by markotoplak, 2 years ago (diff)

Moved caching, collections, debugging, fileutil, r, testing from misc to utils.

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