summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gobject.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_gobject.py b/tests/test_gobject.py
index f5a65bba..fbc3bb79 100644
--- a/tests/test_gobject.py
+++ b/tests/test_gobject.py
@@ -67,6 +67,25 @@ def test_gobject_weak_ref():
class TestGObjectAPI(unittest.TestCase):
+ def test_run_dispose(self):
+ class TestObject(GObject.GObject):
+ int_prop = GObject.Property(default=0, type=int)
+
+ obj = TestObject()
+ called = []
+
+ def on_notify(*args):
+ called.append(args)
+
+ obj.connect('notify::int-prop', on_notify)
+ obj.notify("int-prop")
+ obj.notify("int-prop")
+ # after this everything should be disconnected
+ obj.run_dispose()
+ obj.notify("int-prop")
+ obj.notify("int-prop")
+ assert len(called) == 2
+
def test_call_method_uninitialized_instance(self):
obj = GObject.Object.__new__(GObject.Object)
with self.assertRaisesRegex(RuntimeError, '.*is not initialized'):