Exemplo n.º 1
0
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()
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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()
Exemplo n.º 4
0
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