HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
ftest_DRCEManager.py
Go to the documentation of this file.
1 import unittest
2 from drce.DRCEManager import DRCEManager
3 from drce.Commands import TaskExecuteRequest
4 from drce.DRCEManager import HostParams
5 from drce.DRCEManager import ConnectionTimeout, TransportInternalErr, CommandExecutorErr
6 
7 
8 class TestDRCEManager(unittest.TestCase):
9 
10  def setUp(self):
11  hostParams = HostParams("10.0.0.10", 2323)
13  self.drce_manager.activate_host(hostParams)
14 
15 
17  #
18  request_id = "101"
19  taskExecuteRequest = TaskExecuteRequest(request_id)
20  #set taskExecuteRequest fields
21  taskExecuteRequest.data.session = "Some data"
22  timeout = 2000
23 
24  try:
25  task_response = self.drce_manager.process(taskExecuteRequest, timeout)
26 
27  except (ConnectionTimeout, TransportInternalErr, CommandExecutorErr) as err:
28  print "Some err ", err.message
29 
30 
31  print task_response
wrapper for task request
Definition: Commands.py:158