def test_c_to_py_of_g_type(self): result = c_to_py(hash(GO.TYPE_GTYPE), GO.TYPE_GTYPE) self.assertEqual(GO.TYPE_GTYPE, result)
def test_c_to_py_of_true_type(self): result = c_to_py(1, GO.TYPE_BOOLEAN) self.assertTrue(result)
def test_c_to_py_of_char_type(self): result = c_to_py(ord(b'a'), GO.TYPE_CHAR) self.assertEqual(b'a', result)
def test_c_to_py_of_my_type(self): py_instance = KillerTofu() py_instance.prop = 25 pypointer = capsule_ptr(py_instance.__gpointer__) new_pyinstance = c_to_py(pypointer, KillerTofu.__gtype__) self.assertEqual(25, new_pyinstance.prop)
def test_c_to_py_of_false_type(self): result = c_to_py(0, GO.TYPE_BOOLEAN) self.assertFalse(result)