def test_simple_process(): for ip_address in ip_addresses: nanny = Nanny() command = "python %s --callback=%s"%(get_test_functions_path(ip_address),"success_function") pyc = PythonChildProcess(name="Process", ip_address=ip_address,command=command) nanny.register_child_process(pyc,) with captured_output() as (out,err): nanny.execute_all_child_processes() assert "%s: Success"%(pyc.get_name()) == out.getvalue().strip()
def test_several_simple_processes(N): for ip_address in ip_addresses: nanny = Nanny() command = "python %s --callback=%s"%(get_test_functions_path(ip_address),"success_function") for i in range(N): pyc = PythonChildProcess(name="Process%i"%i, ip_address=ip_address,command=command) nanny.register_child_process(pyc,) with captured_output() as (out,err): nanny.execute_all_child_processes() out_value = out.getvalue().strip() for pyc in nanny.managed_child_processes.values(): assert "%s: Success"%(pyc.get_name()) in out_value
def test_simple_process(): for ip_address in ip_addresses: nanny = Nanny() command = "python %s --callback=%s" % ( get_test_functions_path(ip_address), "success_function") pyc = PythonChildProcess(name="Process", ip_address=ip_address, command=command) nanny.register_child_process(pyc, ) with captured_output() as (out, err): nanny.execute_all_child_processes() assert "%s: Success" % (pyc.get_name()) == out.getvalue().strip()
def test_several_simple_processes(N): for ip_address in ip_addresses: nanny = Nanny() command = "python %s --callback=%s" % ( get_test_functions_path(ip_address), "success_function") for i in range(N): pyc = PythonChildProcess(name="Process%i" % i, ip_address=ip_address, command=command) nanny.register_child_process(pyc, ) with captured_output() as (out, err): nanny.execute_all_child_processes() out_value = out.getvalue().strip() for pyc in nanny.managed_child_processes.values(): assert "%s: Success" % (pyc.get_name()) in out_value