source: orange/Orange/testing/unit/tests/test_display_name_mapping.py @ 11011:2c2fbe61394d

Revision 11011:2c2fbe61394d, 1.0 KB checked in by Miha Stajdohar <miha.stajdohar@…>, 18 months ago (diff)

Excluded network module from test name mapping.

Line 
1try:
2    import unittest2 as unittest
3except:
4    import unittest
5
6import orange, Orange
7
8class TestNameMapping(unittest.TestCase):
9
10    def test_qualified_names(self):
11        """ Test that qualified names of core C++ objects
12        map to the correct name in the Orange.* hierarchy.
13         
14        """
15        #modules in exempt contain source files intended for addons
16        exempt = ["Orange.multitarget.tree",
17                  "Orange.network", ]
18
19        for cls in orange.__dict__.values():
20            if type(cls) == type:
21                if cls.__module__ in exempt:
22                    continue
23                try:
24                    cls2 = eval(cls.__module__ + "." + cls.__name__)
25                except AttributeError as err:
26                    self.assertTrue(False, cls.__module__ + "." + \
27                                    cls.__name__ + " does not exist")
28
29                self.assertEqual(cls2, cls)
30#                if cls2 != cls:
31#                    print cls.__module__+"."+cls.__name__
32
33if __name__ == "__main__":
34    unittest.main()
Note: See TracBrowser for help on using the repository browser.