diff options
author | Robert McQueen <robot101@debian.org> | 2005-11-04 12:18:00 +0000 |
---|---|---|
committer | Robert McQueen <robot101@debian.org> | 2005-11-04 12:18:00 +0000 |
commit | ac36149533cdf3131dec3f43a7e9ea1ee11937f5 (patch) | |
tree | cc5a2cf3836d43ab52959d3b95b1fee04dbf510d /test/python/test-client.py | |
parent | e20c311b131246019ade0c964596a7fda758de68 (diff) |
2005-11-04 Robert McQueen <robot101@debian.org>
* python/dbus_bindings.pyx, test/python/test-client.py: Fix
marshalling of boolean values. Add some booleans to the values in
the test client.
* python/decorators.py, python/service.py: Add an 'async_callbacks'
argument to the dbus.service.method decorator, which allows you to
name arguments to take two callback functions for replying with
return values or an exception.
* test/python/test-client.py, test/python/test-service.py: Add test
case using asynchronous method reply functions, both return values and
errors, and from within both the function itself and from a mainloop
callback.
* python/decorators.py, python/service.py: Perform checking that the
number of method/signal arguments matches the number of types in the
signature at class loading time, not when you first introspect the
class.
* python/service.py: Remove debug print left by the last commit.
Diffstat (limited to 'test/python/test-client.py')
-rwxr-xr-x | test/python/test-client.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/python/test-client.py b/test/python/test-client.py index 433caac9..8c09b67e 100755 --- a/test/python/test-client.py +++ b/test/python/test-client.py @@ -29,6 +29,7 @@ test_types_vals = [1, 12323231, 3.14159265, 99999999.99, (1,2,3), (1,), (1,"2",3), ("2", "what"), ("you", 1.2), {1:"a", 2:"b"}, {"a":1, "b":2}, #{"a":(1,"B")}, {1:1.1, 2:2.2}, [[1,2,3],[2,3,4]], [["a","b"],["c","d"]], + True, False, #([1,2,3],"c", 1.2, ["a","b","c"], {"a": (1,"v"), "b": (2,"d")}) ] @@ -153,6 +154,21 @@ class TestDBusBindings(unittest.TestCase): print "CheckInheritance returned %s" % ret self.assert_(ret, "overriding CheckInheritance from TestInterface failed") + def testAsyncMethods(self): + print "\n********* Testing asynchronous method implementation *******" + for (async, fail) in ((False, False), (False, True), (True, False), (True, True)): + try: + val = ('a', 1, False, [1,2], {1:2}) + print "calling AsynchronousMethod with %s %s %s" % (async, fail, val) + ret = self.iface.AsynchronousMethod(async, fail, val) + except Exception, e: + print "%s:\n%s" % (e.__class__, e) + self.assert_(fail) + else: + self.assert_(not fail) + print val, ret + self.assert_(val == ret) + class TestDBusPythonToGLibBindings(unittest.TestCase): def setUp(self): self.bus = dbus.SessionBus() |