def test_append_ByteArray(self): aeq = self.assertEquals from _dbus_bindings import SignalMessage s = SignalMessage('/', 'foo.bar', 'baz') s.append(types.ByteArray('ab'), signature='ay') aeq(s.get_args_list(), [[types.Byte('a'), types.Byte('b')]]) s = SignalMessage('/', 'foo.bar', 'baz') s.append(types.ByteArray('ab'), signature='av') aeq(s.get_args_list(), [[types.Byte('a'), types.Byte('b')]])
def test_guess_signature(self): aeq = self.assertEquals from _dbus_bindings import Message aeq(Message.guess_signature(('a', 'b')), '(ss)') aeq(Message.guess_signature('a', 'b'), 'ss') aeq(Message.guess_signature(['a', 'b']), 'as') aeq(Message.guess_signature(('a', )), '(s)') aeq(Message.guess_signature('abc'), 's') aeq(Message.guess_signature(types.Int32(123)), 'i') aeq(Message.guess_signature(types.ByteArray('abc')), 'ay') aeq(Message.guess_signature(('a', )), '(s)') aeq(Message.guess_signature(['a']), 'as') aeq(Message.guess_signature({'a': 'b'}), 'a{ss}')
def test_ByteArray(self): self.assertEqual(types.ByteArray(b''), b'')