Exemple #1
0
    def test_objcclass_can_produce_objcmetaclass(self):
        """Creating an ObjCClass for a metaclass pointer gives an ObjCMetaclass."""

        examplemeta_ptr = objc.objc_getMetaClass(b"Example")
        ExampleMeta = ObjCClass(examplemeta_ptr)
        self.assertEqual(ExampleMeta, ObjCMetaClass("Example"))
        self.assertIsInstance(ExampleMeta, ObjCMetaClass)
Exemple #2
0
    def test_metaclass_by_pointer(self):
        """An Objective-C metaclass can be created from a pointer."""

        examplemeta_ptr = objc.objc_getMetaClass(b"Example")
        ExampleMeta = ObjCMetaClass(examplemeta_ptr)
        self.assertEqual(ExampleMeta, ObjCMetaClass("Example"))