示例#1
0
 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)
示例#2
0
 def test_c_to_py_of_true_type(self):
     result = c_to_py(1, GO.TYPE_BOOLEAN)
     self.assertTrue(result)
示例#3
0
 def test_c_to_py_of_char_type(self):
     result = c_to_py(ord(b'a'), GO.TYPE_CHAR)
     self.assertEqual(b'a', result)
示例#4
0
 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)
示例#5
0
 def test_c_to_py_of_false_type(self):
     result = c_to_py(0, GO.TYPE_BOOLEAN)
     self.assertFalse(result)
示例#6
0
 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)
示例#7
0
 def test_c_to_py_of_char_type(self):
     result = c_to_py(ord(b'a'), GO.TYPE_CHAR)
     self.assertEqual(b'a', result)
示例#8
0
 def test_c_to_py_of_true_type(self):
     result = c_to_py(1, GO.TYPE_BOOLEAN)
     self.assertTrue(result)
示例#9
0
 def test_c_to_py_of_false_type(self):
     result = c_to_py(0, GO.TYPE_BOOLEAN)
     self.assertFalse(result)
示例#10
0
 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)