Пример #1
0
 def testJPClass_class(self):
     js = JClass("java.lang.String")
     _jpype.fault("PyJPClass_class")
     with self.assertRaisesRegex(SystemError, "fault"):
         js.class_
     with self.assertRaises(AttributeError):
         _jpype._JClass("foo", (_jpype.JObject, ), {}, internal=True).class_
     _jpype.fault("PyJPModule_getContext")
     with self.assertRaisesRegex(SystemError, "fault"):
         js.class_
Пример #2
0
 def testJPClass_init(self):
     _jpype.fault("PyJPClass_init")
     with self.assertRaises(SystemError):
         _jpype._JClass("foo", (_jpype._JObject, ), {}, internal=True)
     with self.assertRaises(TypeError):
         _jpype._JClass("foo", (object, ), {})
     _jpype._JClass("foo", (_jpype._JObject, ), {}, internal=True)
Пример #3
0
 def testJPClass_new(self):
     _jpype.fault("PyJPClass_new")
     with self.assertRaisesRegex(SystemError, "fault"):
         _jpype._JClass("foo", (object, ), {})
     with self.assertRaises(TypeError):
         _jpype._JClass("foo", (object, ), {})
     with self.assertRaises(TypeError):
         _jpype._JClass("foo", (_jpype._JObject, ), {'__del__': None})