Exemplo n.º 1
0
 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_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_guess_signature_python_ints(self):
     aeq = self.assertEqual
     from _dbus_bindings import Message
     aeq(Message.guess_signature(7), 'i')
     if is_py2:
         aeq(Message.guess_signature(make_long(7)), 'x')