Ejemplo n.º 1
0
def test_compss_flags_parameter():
    context.set_pycompss_context(context.MASTER)
    flags = "my_flags"
    my_compss = COMPSs(app_name="date", flags=flags)
    f = my_compss(dummy_function)
    _ = f()
    context.set_pycompss_context(context.OUT_OF_SCOPE)
    assert ("flags"
            in my_compss.kwargs), "flags is not defined in kwargs dictionary."
    assert (flags == my_compss.kwargs["flags"]
            ), "flags parameter has not been initialized."
Ejemplo n.º 2
0
def test_compss_workerInMaster_parameter():  # NOSONAR
    context.set_pycompss_context(context.MASTER)
    worker_in_master = "my_workerInMaster"  # noqa
    my_compss = COMPSs(app_name="date", workerInMaster=worker_in_master)
    f = my_compss(dummy_function)
    _ = f()
    context.set_pycompss_context(context.OUT_OF_SCOPE)
    assert ("workerInMaster" in my_compss.kwargs
            ), "workerInMaster is not defined in kwargs dictionary."
    assert (worker_in_master == my_compss.kwargs["workerInMaster"]
            ), "workerInMaster parameter has not been initialized."
Ejemplo n.º 3
0
def test_compss_call_outside():
    context.set_pycompss_context(context.OUT_OF_SCOPE)
    my_compss = COMPSs(app_name="date")
    f = my_compss(dummy_function)
    thrown = False
    try:
        _ = f()
    except Exception:  # noqa
        thrown = True  # this is OK!
    assert thrown, \
        "The compss decorator did not raise an exception when invoked out of scope."  # noqa: E501
Ejemplo n.º 4
0
def test_compss_appName_parameter():  # NOSONAR
    context.set_pycompss_context(context.MASTER)
    app_name = "my_appName"  # noqa
    my_compss = COMPSs(app_name="date", appName=app_name)
    f = my_compss(dummy_function)
    _ = f()
    context.set_pycompss_context(context.OUT_OF_SCOPE)
    assert (
        "appName"
        in my_compss.kwargs), "appName is not defined in kwargs dictionary."
    assert (app_name == my_compss.kwargs["appName"]
            ), "appName parameter has not been initialized."
Ejemplo n.º 5
0
def test_compss_instantiation():
    context.set_pycompss_context(context.MASTER)
    my_compss = COMPSs(app_name="date")
    context.set_pycompss_context(context.OUT_OF_SCOPE)
    assert (my_compss.decorator_name == "@compss"
            ), "The decorator name must be @compss."