def test_01_02_send_and_receive(self):
     with self.ZMQServer() as server:
         with self.ZMQClient(server.analysis_id) as client:
             client.send(
                 Z.AnalysisRequest(server.analysis_id, msg=CLIENT_MESSAGE))
             req = server.recv(10.)
             self.assertIsInstance(req, Z.AnalysisRequest)
             self.assertEqual(req.msg, CLIENT_MESSAGE)
             req.reply(Z.Reply(msg=SERVER_MESSAGE))
             response = client.recv()
             self.assertEqual(response.msg, SERVER_MESSAGE)
 def test_02_01_boundary_exit_after_send(self):
     with self.ZMQServer() as server:
         with self.ZMQClient(server.analysis_id) as client:
             client.send(
                 Z.AnalysisRequest(server.analysis_id, msg=CLIENT_MESSAGE))
             req = server.recv(10.)
             self.assertIsInstance(req, Z.AnalysisRequest)
             self.assertEqual(req.msg, CLIENT_MESSAGE)
             server.cancel()
             req.reply(Z.Reply(msg=SERVER_MESSAGE))
             response = client.recv()
             self.assertIsInstance(response, Z.BoundaryExited)
Exemple #3
0
 def test_01_02_send_and_receive(self):
     logger.info("Executing test_01_02_send_and_receive")
     with self.ZMQServer() as server:
         with self.ZMQClient(server.analysis_id) as client:
             logger.info("Sending client an analysis request message")
             client.send(
                 Z.AnalysisRequest(server.analysis_id, msg=CLIENT_MESSAGE))
             logger.info("Message given to client")
             req = server.recv(10.)
             logger.info("Message received from server")
             self.assertIsInstance(req, Z.AnalysisRequest)
             self.assertEqual(req.msg, CLIENT_MESSAGE)
             req.reply(Z.Reply(msg=SERVER_MESSAGE))
             response = client.recv()
             self.assertEqual(response.msg, SERVER_MESSAGE)