diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:46:23 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:46:27 +0900 |
commit | 392945d666d2cfb31a844826a72b1eb65a52546f (patch) | |
tree | a21354051734cbace4e92d6b10c8fa8cd2721dda /tests/test_gobject.py | |
parent | 4723e0bb24cc41607e5af3bb7036855fa767df0b (diff) | |
download | pygobject2-392945d666d2cfb31a844826a72b1eb65a52546f.tar.gz pygobject2-392945d666d2cfb31a844826a72b1eb65a52546f.tar.bz2 pygobject2-392945d666d2cfb31a844826a72b1eb65a52546f.zip |
Imported Upstream version 3.25.1
Change-Id: I31412b37aa390505e71295f3a2c2e3cf2ba88b41
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'tests/test_gobject.py')
-rw-r--r-- | tests/test_gobject.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/test_gobject.py b/tests/test_gobject.py index 39a277b..c380d72 100644 --- a/tests/test_gobject.py +++ b/tests/test_gobject.py @@ -8,22 +8,26 @@ import warnings from gi.repository import GObject, GLib from gi import PyGIDeprecationWarning from gi.module import get_introspection_module - -import gi -_gobject = gi._gi._gobject +from gi import _gi import testhelper class TestGObjectAPI(unittest.TestCase): + + def test_call_method_uninitialized_instance(self): + obj = GObject.Object.__new__(GObject.Object) + with self.assertRaisesRegex(RuntimeError, '.*is not initialized'): + obj.notify("foo") + def test_gobject_inheritance(self): # GObject.Object is a class hierarchy as follows: # overrides.Object -> introspection.Object -> static.GObject GIObjectModule = get_introspection_module('GObject') self.assertTrue(issubclass(GObject.Object, GIObjectModule.Object)) - self.assertTrue(issubclass(GIObjectModule.Object, _gobject.GObject)) + self.assertTrue(issubclass(GIObjectModule.Object, _gi.GObject)) - self.assertEqual(_gobject.GObject.__gtype__, GObject.TYPE_OBJECT) + self.assertEqual(_gi.GObject.__gtype__, GObject.TYPE_OBJECT) self.assertEqual(GIObjectModule.Object.__gtype__, GObject.TYPE_OBJECT) self.assertEqual(GObject.Object.__gtype__, GObject.TYPE_OBJECT) |