source: orange/Orange/testing/unit/tests/test_display_name_mapping.py @ 11008:28a063b479bf

Revision 11008:28a063b479bf, 1.0 KB checked in by Miha Stajdohar <miha.stajdohar@…>, 18 months ago (diff)

Moved network references to Orange Network add-on.

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.