def add_to_ui(self, app): wrapper = GObject.GObject() wrapper.slot = copy.deepcopy(self) app.slot_list.append((self.id, self.type, wrapper))
def testNewInstanceHasTwoRefs(self): obj = GObject.GObject() self.assertEqual(sys.getrefcount(obj), 2)
def testRegularObject(self): obj = GObject.GObject() self.assertEqual(obj.__grefcount__, 1) obj = GObject.new(GObject.GObject) self.assertEqual(obj.__grefcount__, 1)
def test_new_instance_has_two_refs(self): obj = GObject.GObject() self.assertEqual(sys.getrefcount(obj), 2)
def testGObjectModule(self): obj = GObject.GObject() self.assertEqual(obj.__module__, 'gi._gobject._gobject')
def test_inval2(self): a = GObject.GObject() t = a.__gtype__ inval = t.parent # pygobject doesn't like it self.assertEqual(inval.pytype, None)
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))
def testGoodArguments(self): tasklet.WaitForSignal(GObject.GObject(), 'notify')
def testBadArguments(self): self.assertRaises(TypeError, tasklet.WaitForSignal, '', '') self.assertRaises(ValueError, tasklet.WaitForSignal, GObject.GObject(), 'foo')
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)