Beispiel #1
0
 def add_to_ui(self, app):
     wrapper = GObject.GObject()
     wrapper.slot = copy.deepcopy(self)
     app.slot_list.append((self.id, self.type, wrapper))
Beispiel #2
0
 def testNewInstanceHasTwoRefs(self):
     obj = GObject.GObject()
     self.assertEqual(sys.getrefcount(obj), 2)
Beispiel #3
0
    def testRegularObject(self):
        obj = GObject.GObject()
        self.assertEqual(obj.__grefcount__, 1)

        obj = GObject.new(GObject.GObject)
        self.assertEqual(obj.__grefcount__, 1)
Beispiel #4
0
 def test_new_instance_has_two_refs(self):
     obj = GObject.GObject()
     self.assertEqual(sys.getrefcount(obj), 2)
Beispiel #5
0
    def testGObjectModule(self):
        obj = GObject.GObject()

        self.assertEqual(obj.__module__, 'gi._gobject._gobject')
Beispiel #6
0
 def test_inval2(self):
     a = GObject.GObject()
     t = a.__gtype__
     inval = t.parent
     # pygobject doesn't like it
     self.assertEqual(inval.pytype, None)
Beispiel #7
0
 def test_repr(self):
     a = GObject.GObject()
     t = a.__gtype__
     self.assertTrue("GType" in repr(t))
     self.assertTrue("80" in repr(t))
     self.assertTrue("GObject" in repr(t))
Beispiel #8
0
 def testGoodArguments(self):
     tasklet.WaitForSignal(GObject.GObject(), 'notify')
Beispiel #9
0
 def testBadArguments(self):
     self.assertRaises(TypeError, tasklet.WaitForSignal, '', '')
     self.assertRaises(ValueError, tasklet.WaitForSignal, GObject.GObject(),
                       'foo')
Beispiel #10
0
def test_signal_parse_name():
    obj = GObject.GObject()
    assert GObject.signal_parse_name("notify", obj, True) == (1, 0)

    with pytest.raises(ValueError):
        GObject.signal_parse_name("foobar", obj, True)