def thread(server): ident, msg = server.socket.recv() self.assertEqual(msg, process.ExecuteRequest('cat')) server.socket.send(ident, process.ExecuteReply(2345)) ident, msg = server.socket.recv() self.assertEqual( msg, process.StreamAction(2345, process.STDIN, b'asdf\n')) server.socket.send(ident, ack.Acknowledgement()) server.socket.send( ident, process.StreamUpdate(2345, process.STDOUT, b'asdf\n')) ident, msg = server.socket.recv() self.assertEqual(msg, process.StreamAction(2345, process.STDIN)) server.socket.send(ident, ack.Acknowledgement()) server.socket.send(ident, process.StreamUpdate(2345, process.STDOUT)) server.socket.send(ident, process.StreamUpdate(2345, process.STDERR)) server.socket.send(ident, process.ExitUpdate(2345, 0))
def target(): try: func(self) ident, msgs = self.socket.recv_multipart() self.testcase.assertEqual(msgs, [ motor.Action(port, motor.POWER, 0) for port in range(0, 4) ] + [servo.Action(port, False, 0) for port in range(0, 4)]) self.socket.send_multipart( ident, [ack.Acknowledgement() for i in range(0, 8)]) func.exc = None except Exception as exc: traceback.print_exc() func.exc = exc
def thread(server): ident, msg = server.socket.recv() self.assertEqual(msg, servo.Action(0, False, 0)) server.socket.send(ident, ack.Acknowledgement())
def thread(server): ident, msg = server.socket.recv() self.assertEqual(msg, motor.SetPositionAction(0, 0)) server.socket.send(ident, ack.Acknowledgement())
def thread(server): ident, msg = server.socket.recv() self.assertEqual(msg, io.StateAction(0, io.OUTPUT_OFF)) server.socket.send(ident, ack.Acknowledgement())
def thread(server): ident, msg = server.socket.recv() self.assertEqual(msg, analog.Request(0)) server.socket.send(ident, ack.Acknowledgement(ack.UNSUPPORTED_COMMAND))