Exemplo n.º 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)
Exemplo n.º 2
0
 def test_c_to_py_of_true_type(self):
     result = c_to_py(1, GO.TYPE_BOOLEAN)
     self.assertTrue(result)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 5
0
 def test_c_to_py_of_false_type(self):
     result = c_to_py(0, GO.TYPE_BOOLEAN)
     self.assertFalse(result)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 8
0
 def test_c_to_py_of_true_type(self):
     result = c_to_py(1, GO.TYPE_BOOLEAN)
     self.assertTrue(result)
Exemplo n.º 9
0
 def test_c_to_py_of_false_type(self):
     result = c_to_py(0, GO.TYPE_BOOLEAN)
     self.assertFalse(result)
Exemplo n.º 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)