2 Created on Feb 13, 2014 7 from mock
import MagicMock
39 "error_message" :"msg", 44 {"files":[{"name":"f1", "data":"data1", "action":12}], 55 connect_mock_cfg = {
"send.return_value":
None,
56 "recv.return_value": response}
60 connect_expect_calls = [call.send(ANY), call.recv(ANY)]
67 test_err_str =
"json parsing is failed" 68 self.assertEqual(task_response.error_code, 0, test_err_str)
69 self.assertEqual(task_response.error_msg,
"msg", test_err_str )
70 self.assertEqual(task_response.state, 1, test_err_str)
71 self.assertEqual(len(task_response.data), 1, test_err_str)
72 self.assertEqual(task_response.pid, 101, test_err_str)
81 with self.assertRaises(ConnectionTimeout):
92 with self.assertRaises(CommandExecutorErr):
102 with self.assertRaises(CommandExecutorErr):
def test_catch_convert_exception_msg_format(self)
def teEst_execute_request(self)
It's a wrapper similar to zmsg.hpp in sense of encapsulation of hce response message structure...
def execute(self, commands, nodes)
execute method execute incoming commands on nodes, keepts reult in responses and responsesDicts field...
def test_let_out_timeout_exception(self)
Exception which inform about errors which appeared during parsing procedure of drce message protocol...
def test_catch_convert_exception_cmd_format(self)
Convertor which used to convert Task*Reques to json and TaskResponse from json.