Exemplo n.º 1
0
def test_setup_filebacked(tmpdir, local_helloworld_wflow):
	thefile = tmpdir.join('state.json')
	thefile.write(json.dumps(local_helloworld_wflow.json()))
	model = load_model_fromstring('filebacked:'+str(thefile))
	assert type(model) == FileBackedModel
	ctrl = setup_controller(model)
	assert type(ctrl) == PersistentController
Exemplo n.º 2
0
def test_setup_filebacked(tmpdir, local_helloworld_wflow):
    thefile = tmpdir.join("state.json")
    thefile.write(json.dumps(local_helloworld_wflow.json()))
    model = load_model_fromstring("filebacked:" + str(thefile))
    assert type(model) == FileBackedModel
    ctrl = setup_controller(model)
    assert type(ctrl) == PersistentController
Exemplo n.º 3
0
def test_from_pythonctrl(tmpdir, local_helloworld_wflow):
	thefile = tmpdir.join('state.json')
	thefile.write(json.dumps(local_helloworld_wflow.json()))
	model = load_model_fromstring('filebacked:'+str(thefile))
	assert type(model) == FileBackedModel
	ctrl = setup_controller(model, controller = 'py:yadage.controllers:PersistentController', ctrlopts = {'pass_model': True})
	assert type(ctrl) == PersistentController
	assert ctrl.model is not None
Exemplo n.º 4
0
def test_from_pythonctrl(tmpdir, local_helloworld_wflow):
    thefile = tmpdir.join('state.json')
    thefile.write(json.dumps(local_helloworld_wflow.json()))
    model = load_model_fromstring('filebacked:' + str(thefile))
    assert type(model) == FileBackedModel
    ctrl = setup_controller(
        model,
        controller='py:yadage.controllers:PersistentController',
        ctrlopts={'pass_model': True})
    assert type(ctrl) == PersistentController
    assert ctrl.model is not None
Exemplo n.º 5
0
def test_setup_inmem(tmpdir, local_helloworld_wflow):
	model = load_model_fromstring('inmem', initmodel = local_helloworld_wflow)
	assert type(model) == YadageWorkflow
	ctrl = setup_controller(model)
	assert type(ctrl) == YadageController
Exemplo n.º 6
0
def test_setup_inmem(tmpdir, local_helloworld_wflow):
    model = load_model_fromstring("inmem", initmodel=local_helloworld_wflow)
    assert type(model) == YadageWorkflow
    ctrl = setup_controller(model)
    assert type(ctrl) == YadageController