dbus/test/python test-client.py,1.10,1.11
Robert McQueen
robot101 at freedesktop.org
Thu Nov 3 13:47:33 PST 2005
Update of /cvs/dbus/dbus/test/python
In directory gabe:/tmp/cvs-serv16001/test/python
Modified Files:
test-client.py
Log Message:
2005-11-03 Robert McQueen <robot101 at debian.org>
* python/service.py: Heavy refactoring of method invocation, with
hopefully no effect on functionality. Nuked _dispatch_dbus_method_call
in favour of a new _message_cb that uses seperate functions for
looking up the method to call, marshalling the return values, and
sending exceptions as errors, and is easier to follow as a
consequence. Fixes some corner cases about returning things that
don't match your declared out_signature, allows exceptions to define
_dbus_error_name and have it be sent over the bus as the error name,
and paves the way for cool stuff like heeding the message no reply
flag, asynchronous method implementations, informing the method of the
sender, and including backtraces in the error messages.
* test/python/test-client.py: Catch and print exceptions thrown in the
async callback tests, rather than passing them to the low-level
bindings to be ignored in a noisy and frustrating manner.
Index: test-client.py
===================================================================
RCS file: /cvs/dbus/dbus/test/python/test-client.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- test-client.py 3 Nov 2005 16:13:53 -0000 1.10
+++ test-client.py 3 Nov 2005 21:47:31 -0000 1.11
@@ -83,11 +83,14 @@
self.test_controler = test_controler
def callback(self, val):
- if self.do_exit:
- main_loop.quit()
+ try:
+ if self.do_exit:
+ main_loop.quit()
+
+ self.test_controler.assertEquals(val, self.expected_result)
+ except Exception, e:
+ print "%s:\n%s" % (e.__class__, e)
- self.test_controler.assertEquals(val, self.expected_result)
-
def error_handler(self, error):
print error
if self.do_exit:
More information about the dbus-commit
mailing list