From 2afba7e53cf65fccfd15c87852e791845cff8467 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 27 Sep 2007 18:19:16 +0100 Subject: [PATCH] Update NEWS, and add regression tests for fd.o #12096 and #12403 --- NEWS | 11 +++++++++++ test/test-client.py | 15 +++++++++++++++ test/test-service.py | 8 ++++++++ 3 files changed, 34 insertions(+) diff --git a/NEWS b/NEWS index e5587da..ae4d1c7 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,17 @@ D-Bus Python Bindings 0.82.3 (unreleased) Fixes: * Out-of-tree builds with an absolute $(srcdir) can now build docs and run tests +* Closing private dbus.Bus no longer raises KeyError (fd.o #12096) +* async_err_cb(MyException()) now works (fd.o #12403) +* dbus.service.Object.remove_from_connection no longer claims that multiple + exports aren't possible (fd.o #12432) +* Setting _dbus_error_name as a class attribute of DBusException subclasses + works again + +Deprecations: + +* dbus.Bus(private=True) (use dbus.bus.BusConnection in new code, dbus.Bus + basically just adds the shared-connection behaviour) D-Bus Python Bindings 0.82.2 (2007-08-01) ========================================= 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) -- 2.11.4.GIT