Пример #1
0
def test_python_module():
    mod = MyModule("mymodule", text="spam")
    mod.configure(mod.params, mod.inputs, mod.outputs)
    assert mod.text == "spam"
    assert mod.params.text == "spam"
    mod.process(mod.inputs, mod.outputs)
    print mod.outputs.out
    assert mod.outputs.out == "spam" * 2
def test_python_module():
    mod = MyModule("mymodule", text="spam")
    mod.configure(mod.params, mod.inputs, mod.outputs)
    assert mod.text == "spam"
    assert mod.params.text == "spam"
    mod.process(mod.inputs,mod.outputs)
    print mod.outputs.out
    assert mod.outputs.out == "spam"*2
Пример #3
0
def test_python_module_plasm(Schedtype):
    print "*" * 80
    print Schedtype
    mod = MyModule(text="spam")
    mod.configure(mod.params, mod.inputs, mod.outputs)
    g = ecto_test.Generate(start=1, step=1)
    plasm = ecto.Plasm()
    plasm.connect(g, "out", mod, "input")
    sched = Schedtype(plasm)
    for i in range(1, 5):
        print "HERE"
        sched.execute(niter=1)
        sched.prepare_jobs(niter=1)
        sched.run()
        assert g.outputs.out == i * 2
        assert mod.outputs.out == "spam" * i * 2

    sched.execute(niter=1)
    sched.prepare_jobs(niter=1)
    sched.run()
    assert g.outputs.out == 10
    assert mod.outputs.out == "spam" * 10
def test_python_module_plasm(Schedtype):
    print "*"*80
    print Schedtype
    mod = MyModule(text="spam")
    mod.configure(mod.params, mod.inputs, mod.outputs)
    g = ecto_test.Generate(start = 1 , step =1)
    plasm = ecto.Plasm()
    plasm.connect(g,"out",mod,"input")
    sched = Schedtype(plasm)
    for i in range(1,5):
        print "HERE"
        sched.execute(niter=1)
        sched.prepare_jobs(niter=1)
        sched.run()
        assert g.outputs.out == i*2
        assert mod.outputs.out == "spam"*i*2

    sched.execute(niter=1)
    sched.prepare_jobs(niter=1)
    sched.run()
    assert g.outputs.out == 10
    assert mod.outputs.out == "spam"*10