summaryrefslogtreecommitdiffstats
path: root/tests/signal.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-09-25 17:29:17 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-09-25 17:29:17 +0000
commit98e8f5d07b21abe3b89667124858db5bc607e7c9 (patch)
tree4d1e709deff07c41b0dbea2a41372b1ced102798 /tests/signal.py
parentc67547acbb1d2e2355b0eae659e879df981c9eb3 (diff)
downloadpygobject-98e8f5d07b21abe3b89667124858db5bc607e7c9.tar.gz
pygobject-98e8f5d07b21abe3b89667124858db5bc607e7c9.tar.xz
pygobject-98e8f5d07b21abe3b89667124858db5bc607e7c9.zip
Move some tests from gtype and rename from signal.py
* tests/test_signal.py: Move some tests from gtype and rename from signal.py
Diffstat (limited to 'tests/signal.py')
-rw-r--r--tests/signal.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/signal.py b/tests/signal.py
deleted file mode 100644
index 65eda26..0000000
--- a/tests/signal.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- Mode: Python -*-
-
-import unittest
-
-from common import gobject
-
-class C(gobject.GObject):
- __gsignals__ = { 'my_signal': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- (gobject.TYPE_INT,)) }
- def do_my_signal(self, arg):
- self.arg = arg
-gobject.type_register(C)
-
-class D(C):
- def do_my_signal(self, arg2):
- self.arg2 = arg2
- C.do_my_signal(self, arg2)
-gobject.type_register(D)
-
-class TestChaining(unittest.TestCase):
- def setUp(self):
- self.inst = C()
- self.inst.connect("my_signal", self.my_signal_handler_cb, 1, 2, 3)
-
- def my_signal_handler_cb(self, *args):
- assert len(args) == 5
- assert isinstance(args[0], C)
- assert args[0] == self.inst
-
- assert isinstance(args[1], int)
- assert args[1] == 42
-
- assert args[2:] == (1, 2, 3)
-
- def testChaining(self):
- self.inst.emit("my_signal", 42)
- assert self.inst.arg == 42
-
- def testChaining(self):
- inst2 = D()
- inst2.emit("my_signal", 44)
- assert inst2.arg == 44
- assert inst2.arg2 == 44
-
-if __name__ == '__main__':
- unittest.main()