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
test_admin_Command.py
Go to the documentation of this file.
1 '''
2 Created on Feb 17, 2014
3 
4 @author: scorp
5 '''
6 
7 
8 import unittest
9 from Command import Command
10 
11 standartString = "ECHO\t22@55@44"
12 
13 
14 class TestCommand(unittest.TestCase):
15 
16 
17  def setUp(self):
18  self.command = None
19 
20 
21  def tearDown(self):
22  pass
23 
24 
26  self.command = Command()
27  self.assertEqual(type(self.command.getParams()), type([]), ">> param field type not list")
28  self.assertEqual(len(self.command.getParams()), 0, ">> param field size != 0")
29 
30 
31  def testGenerateBody(self):
32  params = ["22", 55, 44]
33  commandName = "ECHO"
34  self.command = Command(commandName, params)
35  ret = self.command.generateBody()
36  self.assertEqual(ret, standartString, ">> wrong ret")
37 
38 
39 if __name__ == "__main__":
40 # import sys;sys.argv = ['', 'Test.testName']
41  unittest.main()
def generateBody(self)
Main processing method, generate request body string, based on internal field - "param".
Definition: Command.py:59