summaryrefslogtreecommitdiff
path: root/test/test-service.py
diff options
context:
space:
mode:
authorSimon McVittie <smcv@celebrin.pseudorandom.co.uk>2006-11-14 15:48:47 +0000
committerSimon McVittie <smcv@celebrin.pseudorandom.co.uk>2006-11-14 15:48:47 +0000
commit6008b37253f7a04b563b28a2aa9357de8cfd29d1 (patch)
tree3b8a476032f1d8a8aa6a55c426a37520b5de7cab /test/test-service.py
parent21b10a103d91651d9ac55d2d22832a5df251f45e (diff)
downloaddbus-python-6008b37253f7a04b563b28a2aa9357de8cfd29d1.tar.gz
- dbus.service.Object, dbus.decorators.method: Allow utf8_strings and
byte_arrays parameters kwargs when exporting a method. These change the calling convention in the same way as Message.get_args_list(). - dbus.proxies.ProxyMethod: allow the same kwargs to be passed to any proxy method; this time, they change the representation of the remote method's return value(s). - Test that the above work - Improve correctness of setting the NAME_FLAG_* flags - Whitespace tweaks (remove hard tabs)
Diffstat (limited to 'test/test-service.py')
-rwxr-xr-xtest/test-service.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test-service.py b/test/test-service.py
index c7790f2..6c1c043 100755
--- a/test/test-service.py
+++ b/test/test-service.py
@@ -62,6 +62,26 @@ class TestObject(dbus.service.Object, TestInterface):
def Echo(self, arg):
return arg
+ @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='s', out_signature='s')
+ def AcceptUnicodeString(self, foo):
+ assert isinstance(foo, unicode), (foo, foo.__class__.__mro__)
+ return foo
+
+ @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='s', out_signature='s', utf8_strings=True)
+ def AcceptUTF8String(self, foo):
+ assert isinstance(foo, str), (foo, foo.__class__.__mro__)
+ return foo
+
+ @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='ay', out_signature='ay')
+ def AcceptListOfByte(self, foo):
+ assert isinstance(foo, list), (foo, foo.__class__.__mro__)
+ return foo
+
+ @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='ay', out_signature='ay', byte_arrays=True)
+ def AcceptByteArray(self, foo):
+ assert isinstance(foo, str), (foo, foo.__class__.__mro__)
+ return foo
+
@dbus.service.method("org.freedesktop.DBus.TestSuiteInterface")
def GetComplexArray(self):
ret = []