示例#1
0
def test_api_calls():
    from sprokit.pipeline import config
    from vital.modules import modules
    from sprokit.pipeline import process
    from sprokit.pipeline import process_factory

    modules.load_known_modules()

    proc_type = 'orphan'
    c = config.empty_config()

    process_factory.create_process(proc_type, '')
    process_factory.create_process(proc_type, '', c)
    process_factory.types()
    process_factory.description(proc_type)

    process_factory.Process.property_no_threads
    process_factory.Process.property_no_reentrancy
    process_factory.Process.property_unsync_input
    process_factory.Process.property_unsync_output
    process_factory.Process.port_heartbeat
    process_factory.Process.config_name
    process_factory.Process.config_type
    process_factory.Process.type_any
    process_factory.Process.type_none
    process_factory.Process.type_data_dependent
    process_factory.Process.type_flow_dependent
    process_factory.Process.flag_output_const
    process_factory.Process.flag_input_static
    process_factory.Process.flag_input_mutable
    process_factory.Process.flag_input_nodep
    process_factory.Process.flag_required
示例#2
0
def test_api_calls():
    from vital.config import config
    from vital.modules import modules
    from sprokit.pipeline import process
    from sprokit.pipeline import process_factory

    modules.load_known_modules()

    proc_type = 'orphan'
    c = config.empty_config()

    process_factory.create_process(proc_type, '')
    process_factory.create_process(proc_type, '', c)
    process_factory.types()
    process_factory.description(proc_type)

    process_factory.Process.property_no_threads
    process_factory.Process.property_no_reentrancy
    process_factory.Process.property_unsync_input
    process_factory.Process.property_unsync_output
    process_factory.Process.port_heartbeat
    process_factory.Process.config_name
    process_factory.Process.config_type
    process_factory.Process.type_any
    process_factory.Process.type_none
    process_factory.Process.type_data_dependent
    process_factory.Process.type_flow_dependent
    process_factory.Process.flag_output_const
    process_factory.Process.flag_input_static
    process_factory.Process.flag_input_mutable
    process_factory.Process.flag_input_nodep
    process_factory.Process.flag_required
示例#3
0
def test_register_cluster():
    from vital.config import config
    from sprokit.pipeline import process
    from sprokit.pipeline import process_cluster
    from sprokit.pipeline import process_factory

    proc_type = 'python_example'
    proc_desc = 'simple description'

    process_factory.add_process(proc_type, proc_desc,
                                base_example_process_cluster())

    if not proc_desc == process_factory.description(proc_type):
        test_error("Description was not preserved when registering")

    p = None

    try:
        p = process_factory.create_process(proc_type, '')
        if p is None:
            raise Exception()
    except BaseException:
        import sys

        e = sys.exc_info()[1]

        test_error(
            "Could not create newly registered process cluster type: %s" %
            str(e))

    if process_cluster.cluster_from_process(p) is None:
        test_error(
            "A cluster process from the registry was not detected as a cluster process"
        )
示例#4
0
def test_register_cluster():
    from sprokit.pipeline import config
    from sprokit.pipeline import process
    from sprokit.pipeline import process_cluster
    from sprokit.pipeline import process_factory

    proc_type = 'python_example'
    proc_desc = 'simple description'

    process_factory.add_process(proc_type, proc_desc, base_example_process_cluster())

    if not proc_desc == process_factory.description(proc_type):
        test_error("Description was not preserved when registering")

    p = None

    try:
        p = process_factory.create_process(proc_type, '')
        if p is None:
            raise Exception()
    except BaseException:
        import sys

        e = sys.exc_info()[1]

        test_error("Could not create newly registered process cluster type: %s" % str(e))

    if process_cluster.cluster_from_process(p) is None:
        test_error("A cluster process from the registry was not detected as a cluster process")
示例#5
0
def test_api_calls():
    from sprokit.pipeline import config
    from sprokit.pipeline import modules
    from sprokit.pipeline import process
    from sprokit.pipeline import process_factory

    modules.load_known_modules()

    proc_type = 'orphan'
    c = config.empty_config()

    process_factory.create_process(proc_type, process.ProcessName())
    process_factory.create_process(proc_type, process.ProcessName(), c)
    process_factory.types()
    process_factory.description(proc_type)

    process_factory.Process.property_no_threads
    process_factory.Process.property_no_reentrancy
    process_factory.Process.property_unsync_input
    process_factory.Process.property_unsync_output
    process_factory.Process.port_heartbeat
    process_factory.Process.config_name
    process_factory.Process.config_type
    process_factory.Process.type_any
    process_factory.Process.type_none
    process_factory.Process.type_data_dependent
    process_factory.Process.type_flow_dependent
    process_factory.Process.flag_output_const
    process_factory.Process.flag_input_static
    process_factory.Process.flag_input_mutable
    process_factory.Process.flag_input_nodep
    process_factory.Process.flag_required

    cluster_bases = process_factory.ProcessCluster.__bases__
    if not cluster_bases[0] == process_factory.Process:
        test_error("The cluster class does not inherit from the process class")
示例#6
0
def test_register():
    from vital.config import config
    from sprokit.pipeline import process
    from sprokit.pipeline import process_factory

    proc_type = 'python_example'
    proc_desc = 'simple description'

    process_factory.add_process(proc_type, proc_desc, example_process(True))

    if not proc_desc == process_factory.description(proc_type):
        test_error("Description was not preserved when registering")

    try:
        p = process_factory.create_process(proc_type, '')
        if p is None:
            raise Exception()
    except:
        test_error("Could not create newly registered process type")
示例#7
0
def test_register():
    from sprokit.pipeline import config
    from sprokit.pipeline import process
    from sprokit.pipeline import process_factory

    proc_type = 'python_example'
    proc_desc = 'simple description'

    process_factory.add_process(proc_type, proc_desc, example_process(True))

    if not proc_desc == process_factory.description(proc_type):
        test_error("Description was not preserved when registering")

    try:
        p = process_factory.create_process(proc_type, '')
        if p is None:
            raise Exception()
    except:
        test_error("Could not create newly registered process type")