Пример #1
0
def test_visualea_io():
    factory = composite_node()
    model = ModelFactory(mimetype='text/x-visualea', name='test_workflow_io')
    model.set_code(factory)
    controller = paradigm_controller(model)
    new_control('a', 'IInt', 1)
    new_control('b', 'IInt', 2)
    interp.user_ns['c'] = 3
    assert controller.run() == [1, 2, 3, 0]
    assert controller.run(10) == [10, 2, 3, 0]
    assert controller.run(d=5) == [1, 2, 3, 5]
Пример #2
0
def test_visualea_io():
    factory = composite_node()
    model = ModelFactory(mimetype='text/x-visualea', name='test_workflow_io')
    model.set_code(factory)
    controller = paradigm_controller(model)
    new_control('a', 'IInt', 1)
    new_control('b', 'IInt', 2)
    interp.user_ns['c'] = 3
    assert controller.run() == [1, 2, 3, 0]
    assert controller.run(10) == [10, 2, 3, 0]
    assert controller.run(d=5) == [1, 2, 3, 5]
Пример #3
0
def test_create_controllers():
    project = interp.locals['project']
    controllers = []
    for name, data in project.model.items():
        if data.mimetype == 'text/vnd-lpy':
            continue
        controller = paradigm_controller(data)
        varname = name.replace('.', '_')
        interp.locals['controller_%s' % varname] = controller
        interp.locals['item_%s' % varname] = data
        controllers.append(controller)
    return controllers
Пример #4
0
def test_create_controllers():
    project = interp.locals['project']
    controllers = []
    for name, data in project.model.items():
        if data.mimetype == 'text/vnd-lpy':
            continue
        controller = paradigm_controller(data)
        varname = name.replace('.', '_')
        interp.locals['controller_%s' % varname] = controller
        interp.locals['item_%s' % varname] = data
        controllers.append(controller)
    return controllers