summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-05-08 08:37:13 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-05-08 08:37:13 +0100
commit0872782255fdbaeda64311a298664597e59ba94f (patch)
tree73e2394bd12830523fd7541b7eb11a22005c7d47
parentf909f596705f62a5218cf16d61433364fe2f8168 (diff)
downloaddbus-python-0872782255fdbaeda64311a298664597e59ba94f.tar.gz
utf8 test: pass when used with dbus 1.6.10, 1.7.2
We used to reject noncharacters, but now we accept them.
-rwxr-xr-xtest/test-standalone.py41
1 files changed, 25 insertions, 16 deletions
diff --git a/test/test-standalone.py b/test/test-standalone.py
index 584ba4f..459a41d 100755
--- a/test/test-standalone.py
+++ b/test/test-standalone.py
@@ -438,6 +438,28 @@ class TestMessageMarshalling(unittest.TestCase):
for bad in [
uni(0xD800),
utf8(0xed, 0xa0, 0x80),
+ ]:
+ s = SignalMessage('/', 'foo.bar', 'baz')
+ try:
+ s.append(bad, signature='s')
+ except UnicodeError:
+ pass
+ else:
+ raise AssertionError('Appending %r should fail' % bad)
+ for good in [
+ uni(0xfdcf),
+ uni(0xfdf0),
+ uni(0xfeff),
+ uni(0x0001feff),
+ uni(0x00020000),
+ uni(0x0007feff),
+ uni(0x00080000),
+ uni(0x0010feff),
+ ]:
+ s = SignalMessage('/', 'foo.bar', 'baz')
+ s.append(good, signature='s')
+ s.append(good.encode('utf-8'), signature='s')
+ for noncharacter in [
uni(0xFDD0),
utf8(0xef, 0xb7, 0x90),
uni(0xFDD7),
@@ -463,24 +485,11 @@ class TestMessageMarshalling(unittest.TestCase):
]:
s = SignalMessage('/', 'foo.bar', 'baz')
try:
- s.append(bad, signature='s')
+ s.append(noncharacter, signature='s')
except UnicodeError:
- pass
+ pass # libdbus < 1.6.10 disallows noncharacters
else:
- raise AssertionError('Appending %r should fail' % bad)
- for good in [
- uni(0xfdcf),
- uni(0xfdf0),
- uni(0xfeff),
- uni(0x0001feff),
- uni(0x00020000),
- uni(0x0007feff),
- uni(0x00080000),
- uni(0x0010feff),
- ]:
- s = SignalMessage('/', 'foo.bar', 'baz')
- s.append(good, signature='s')
- s.append(good.encode('utf-8'), signature='s')
+ pass # libdbus >= 1.6.10 allows noncharacters
class TestMatching(unittest.TestCase):
def setUp(self):