summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-09-27 18:19:16 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-09-27 18:19:16 +0100
commit2afba7e53cf65fccfd15c87852e791845cff8467 (patch)
treee0c607d9e2e05accd872363a49d7eaef7a70d67c /test
parentcb1ffaea799249d6c2dcc9452f758f57392f55e7 (diff)
downloaddbus-python-2afba7e53cf65fccfd15c87852e791845cff8467.tar.gz
Update NEWS, and add regression tests for fd.o #12096 and #12403
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-client.py15
-rwxr-xr-xtest/test-service.py8
2 files changed, 23 insertions, 0 deletions
diff --git a/test/test-client.py b/test/test-client.py
index 085c208..0d95d72 100755
--- a/test/test-client.py
+++ b/test/test-client.py
@@ -455,6 +455,21 @@ class TestDBusBindings(unittest.TestCase):
self.assertRaises(dbus.DBusException,
lambda: self.iface.BlockFor500ms(timeout=0.25))
+ def testAsyncRaise(self):
+ self.assertRaises(dbus.DBusException, self.iface.AsyncRaise)
+ try:
+ self.iface.AsyncRaise()
+ except dbus.DBusException, e:
+ self.assert_(e.get_dbus_name() ==
+ 'org.freedesktop.bugzilla.bug12403',
+ e.get_dbus_name())
+ else:
+ self.assert_(False)
+
+ def testClosePrivateBus(self):
+ # fd.o #12096
+ dbus.Bus(private=True).close()
+
def testTimeoutAsyncClient(self):
loop = gobject.MainLoop()
passes = []
diff --git a/test/test-service.py b/test/test-service.py
index 10bebc5..02ad7ea 100755
--- a/test/test-service.py
+++ b/test/test-service.py
@@ -301,6 +301,14 @@ class TestObject(dbus.service.Object, TestInterface):
return False
gobject.timeout_add(500, return_from_async_wait)
+ @dbus.service.method(IFACE, in_signature='', out_signature='',
+ async_callbacks=('return_cb', 'raise_cb'))
+ def AsyncRaise(self, return_cb, raise_cb):
+ class Fdo12403Error(dbus.DBusException):
+ _dbus_error_name = 'org.freedesktop.bugzilla.bug12403'
+
+ raise_cb(Fdo12403Error())
+
session_bus = dbus.SessionBus()
global_name = dbus.service.BusName(NAME, bus=session_bus)
object = TestObject(global_name)