diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-07-31 12:38:02 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-07-31 12:38:02 +0100 |
commit | 5ab6cdc200267095edd56645df536dac5d4dc986 (patch) | |
tree | a0856403e11789dc58149e2c3d72346b386267be /test/test-service.py | |
parent | 70f802152547898f225a0a675789fb923a5ea410 (diff) |
Measure async call timeout in seconds as intended, not in ms (blocking calls already used seconds). Add regression tests
Diffstat (limited to 'test/test-service.py')
-rwxr-xr-x | test/test-service.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test-service.py b/test/test-service.py index dcd511e..ef4efe2 100755 --- a/test/test-service.py +++ b/test/test-service.py @@ -22,6 +22,7 @@ import sys import os import logging +from time import sleep builddir = os.path.normpath(os.environ["DBUS_TOP_BUILDDIR"]) pydir = os.path.normpath(os.environ["DBUS_TOP_SRCDIR"]) @@ -279,6 +280,18 @@ class TestObject(dbus.service.Object, TestInterface): # https://bugs.freedesktop.org/show_bug.cgi?id=10174 return dbus.String('abc'), dbus.Int32(123) + @dbus.service.method(IFACE, in_signature='', out_signature='') + def BlockFor500ms(self): + sleep(0.5) + + @dbus.service.method(IFACE, in_signature='', out_signature='', + async_callbacks=('return_cb', 'raise_cb')) + def AsyncWait500ms(self, return_cb, raise_cb): + def return_from_async_wait(): + return_cb() + return False + gobject.timeout_add(500, return_from_async_wait) + session_bus = dbus.SessionBus() global_name = dbus.service.BusName(NAME, bus=session_bus) object = TestObject(global_name) |