source: orange/Orange/testing/unit/tests/test_display_name_mapping.py @ 10278:f3b1ffae9c29

Revision 10278:f3b1ffae9c29, 799 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Unittest2 for python 2.6.

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__
Note: See TracBrowser for help on using the repository browser.