correct some error on test

This commit is contained in:
AleaJactaEst 2018-08-16 21:08:37 +02:00
parent 364f97adf2
commit ecd312fb9a
4 changed files with 23 additions and 8 deletions

View file

@ -553,5 +553,6 @@ def main(arguments=sys.argv[1:]):
organization_name=args.organization_name,
common_name=args.common_name)
if __name__ == '__main__':
main()

View file

@ -427,5 +427,6 @@ def main(args=sys.argv[1:]):
password_comand_line=param.password_comand_line,
password=param.password)
if __name__ == '__main__':
main()

View file

@ -800,6 +800,7 @@ class Manager():
"""
def __init__(self, launch_program):
self.threadCommand = []
self.info = {}
self.command = []
self.launch_program = launch_program
self.param = {}
@ -965,6 +966,16 @@ class Manager():
event))
threadCommand.start()
self.threadCommand.append(threadCommand)
self.info.setdefault(name, {'queueIn': queueIn,
'queueOut': queueOut,
'event': event,
'threadCommand': threadCommand,
'command': self.param[name]['command'],
'path': self.param[name]['path'],
'logsize': self.param[name]['logsize'],
'bufsize': self.param[name]['bufsize']})
if self.launch_program:
event.set()
queueIn.put("START")
@ -1059,5 +1070,6 @@ def main(args=sys.argv[1:]):
launch_program=param.launch_program,
show_log_console=param.show_log_console)
if __name__ == '__main__':
main()

View file

@ -478,10 +478,10 @@ class TestManager(unittest.TestCase):
manage.serverHttp = MockServerHttp()
manage._load_config(config)
manage.launch_command()
queueIn = manage.threadCommand[0]._args[5]
queueOut = manage.threadCommand[0]._args[6]
event = manage.threadCommand[0]._args[7]
for key in manage.info:
queueIn = manage.info[key]['queueIn']
queueOut = manage.info[key]['queueOut']
event = manage.info[key]['event']
queueIn.put("START")
event.set()
@ -564,9 +564,10 @@ class TestManager(unittest.TestCase):
manage._load_config(config)
manage.launch_command()
queueIn = manage.threadCommand[0]._args[5]
queueOut = manage.threadCommand[0]._args[6]
event = manage.threadCommand[0]._args[7]
key = list(manage.info.keys())[0]
queueIn = manage.info[key]['queueIn']
queueOut = manage.info[key]['queueOut']
event = manage.info[key]['event']
signal.alarm(10)
event.set()
@ -625,7 +626,7 @@ class TestManager(unittest.TestCase):
manage._set_headers()
manage.send_response.assert_called_with(200)
manage.send_header.assert_called_with('Content-type', 'application/json')
# manage.send_header.assert_called_with('Content-type', 'application/json')
@patch.object(http.server.SimpleHTTPRequestHandler, '__init__')
def test_run_manage_command_log_1(self, init):