source: orange/Orange/testing/unit/tests/test_display_name_mapping.py @ 10970:e81b129a6f6d

Revision 10970:e81b129a6f6d, 1.0 KB checked in by Miran Levar <mlevar@…>, 20 months ago (diff)

Additional fixes and source modifications

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
18        for cls in orange.__dict__.values():
19            if type(cls) == type:
20                if cls.__module__ in exempt:
21                    continue
22                try:
23                    cls2 = eval(cls.__module__ + "." + cls.__name__)
24                except AttributeError as err:
25                    self.assertTrue(False, cls.__module__ + "." + \
26                                    cls.__name__ + " does not exist")
27
28                self.assertEqual(cls2, cls)
29#                if cls2 != cls:
30#                    print cls.__module__+"."+cls.__name__
31
32if __name__ == "__main__":
33    unittest.main()
Note: See TracBrowser for help on using the repository browser.