Пример #1
0
    def testIntrospectorOnClass(self):
        request = {}
        ints = Introspector(TestClass)
        self.assertEqual(ints.isInterface(), 0)
        request['PATH_INFO'] = (
            '++module++zope.app.tests.test_introspector.TestClass')
        ints.setRequest(request)
        self.assertEqual(ints.getClass(), 'TestClass')

        self.assertEqual(
            ints.getBaseClassNames(),
            ['zope.app.introspector.tests.test_introspector.BaseTestClass'])
        self.assertEqual(
            ints.getModule(),
            'zope.app.introspector.tests.test_introspector')
        self.assertEqual(ints.getDocString(), "This is my stupid doc string")
        self.assertEqual(ints.getInterfaces(), (ITestClass,))
        self.assertEqual(
            ints.getInterfaceNames(),
            ['zope.app.introspector.tests.test_introspector.ITestClass'])
        self.assertEqual(ints.getExtends(), (BaseTestClass,))
Пример #2
0
 def test_getClass(self):
     ints = Introspector(TestClass())
     request = {}
     ints.setRequest(request)
     self.assertEqual(ints.getClass(), 'TestClass')