source: orange/Orange/testing/unit/tests/test_display_name_mapping.py @ 10385:0abf613c460f

Revision 10385:0abf613c460f, 846 bytes checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Added missing if name == "main" part to tests.

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