def test_remotelogging(self): from xpra.server.mixins.logging_server import LoggingServer, log logfn = log.log try: messages = [] def newlogfn(*args): messages.append(args) log.log = newlogfn x = LoggingServer() proto = AdHocStruct() x._server_sources = {proto : "fake-source"} opts = AdHocStruct() opts.remote_logging = "on" x.init(opts) level = 20 msg = "foo" packet = ["logging", level, msg] x._process_logging(proto, packet) assert len(messages)==1 finally: log.log = logfn
def test_invalid(self): l = LoggingServer() opts = AdHocStruct() opts.remote_logging = "on" l.init(opts) l._process_logging(None, None)
def test_invalid(self): l = LoggingServer() opts = AdHocStruct() opts.remote_logging = "on" l.init(opts) l._process_logging(None, None) #pylint: disable=protected-access