Esempio n. 1
0
 def test(value):
     assert not dbusx.check_bus_name(name)
     msg = dbusx.Message(dbusx.MESSAGE_TYPE_METHOD_CALL)
     assert_raises(ValueError, setattr, msg, name, value)
     kwargs = { name: value }
     assert_raises(ValueError, dbusx.Message,
                   dbusx.MESSAGE_TYPE_METHOD_CALL, **kwargs)
Esempio n. 2
0
 def test_echo_multiple_interfaces(self):
     proxy = self.proxy
     assert proxy.EchoString("foo") == "foo"
     assert proxy.EchoString("foo", interface=IFACE_FOO2) == "FOO"
     interfaces = proxy.interfaces
     proxy.interfaces = []
     try:
         # with no search path, we may not guess
         assert_raises(dbusx.Error, proxy.EchoString, "foo")
     finally:
         proxy.interfaces = interfaces
Esempio n. 3
0
 def test_raise_invalid_error(self):
     proxy = self.proxy
     err = assert_raises(dbusx.Error, proxy.RaiseError, "1foo.bar")
     assert err.args[0] == "org.freedesktop.DBus.Error.Failed"
Esempio n. 4
0
 def test_RaiseError(self):
     proxy = self.proxy
     err = assert_raises(dbusx.Error, proxy.RaiseError, "foo.bar")
     assert err.args[0] == "foo.bar"
Esempio n. 5
0
 def test_return_wrong_arg_type(self):
     proxy = self.proxy
     assert_raises(dbusx.Error, proxy.EvalExpr, "1", "s")
     assert_raises(dbusx.Error, proxy.EvalExpr, '"foo"', "i")
Esempio n. 6
0
 def test_return_wrong_arg_count(self):
     proxy = self.proxy
     assert_raises(dbusx.Error, proxy.EvalExpr, "1", "")
     assert_raises(dbusx.Error, proxy.EvalExpr, "(1,)", "")
     assert_raises(dbusx.Error, proxy.EvalExpr, "(1,2)", "")
     assert_raises(dbusx.Error, proxy.EvalExpr, "(1,2)", "i")
     assert_raises(dbusx.Error, proxy.EvalExpr, "1", "ii")
     assert_raises(dbusx.Error, proxy.EvalExpr, "(1,2,3)", "ii")
Esempio n. 7
0
 def test(type):
     assert_raises(ValueError, dbusx.Message, type)
Esempio n. 8
0
 def _illegal_arg_value_test(self, sig, args):
     msg = dbusx.Message(dbusx.MESSAGE_TYPE_METHOD_CALL)
     assert_raises(ValueError, msg.set_args, sig, args)
Esempio n. 9
0
 def test(member):
     assert not dbusx.check_member(member)
     msg = dbusx.Message(dbusx.MESSAGE_TYPE_METHOD_CALL)
     assert_raises(ValueError, setattr, msg, 'member', member)
     assert_raises(ValueError, dbusx.Message,
                   dbusx.MESSAGE_TYPE_METHOD_CALL, member=member)
Esempio n. 10
0
 def test(path):
     assert not dbusx.check_path(path)
     msg = dbusx.Message(dbusx.MESSAGE_TYPE_METHOD_CALL)
     assert_raises(ValueError, setattr, msg, 'path', path)
     assert_raises(ValueError, dbusx.Message,
                  dbusx.MESSAGE_TYPE_METHOD_CALL, path=path)