diff options
| author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-06-05 19:07:51 +0100 |
|---|---|---|
| committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-06-05 19:07:51 +0100 |
| commit | 6ff89bf0d05a550cf1aff2053579fc1f0192cd97 (patch) | |
| tree | 31481b1b8d209d5b1f43af242c2d556a9cfcfed0 /test | |
| parent | 2f08b9e644c8530c4d324c4bd9d8a0cdb24edc92 (diff) | |
| download | dbus-python-6ff89bf0d05a550cf1aff2053579fc1f0192cd97.tar.gz | |
Py3: correctly guess the signature of ObjectPath(...) and Signature(...)
Under Python 2, ObjectPath and Signature are subtypes of str (= bytes),
and the existing type-guessing worked.
The type-guessing code assumed that all unicode objects were just
strings, but that assumption became false in the Python 3 port:
ObjectPath and Signature are still subtypes of str, but str now means
unicode, not bytes.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50740
Diffstat (limited to 'test')
| -rwxr-xr-x | test/test-standalone.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test-standalone.py b/test/test-standalone.py index 95b636a..6f403ee 100755 --- a/test/test-standalone.py +++ b/test/test-standalone.py @@ -322,6 +322,8 @@ class TestMessageMarshalling(unittest.TestCase): aeq(Message.guess_signature(('a',)), '(s)') aeq(Message.guess_signature(['a']), 'as') aeq(Message.guess_signature({'a':'b'}), 'a{ss}') + aeq(Message.guess_signature(types.ObjectPath('/')), 'o') + aeq(Message.guess_signature(types.Signature('x')), 'g') def test_guess_signature_python_ints(self): aeq = self.assertEqual |
