Ejemplo n.º 1
0
def test_tcl_oommf_runner():
    """TclOOMMFRunner runs when OOMMFTCL environment variable is set.

    """
    oommf_tcl = os.environ.get('OOMMFTCL', None)
    oommf_runner = oo.TclOOMMFRunner(oommf_tcl)
    check_runner(oommf_runner)
Ejemplo n.º 2
0
def test_tcl_oommf_runner():
    # TclOOMMFRunner runs when OOMMFTCL environment variable is set. On
    # TravisCI OOMMFTCL environment variable is set inside ubermag/oommf docker
    # image.
    oommf_tcl = os.environ.get('OOMMFTCL', None)
    runner = oo.TclOOMMFRunner(oommf_tcl)
    check_runner(runner)
    assert isinstance(runner.errors(), str)
Ejemplo n.º 3
0
def test_tcl_oommf_runner(monkeypatch):
    runner = oo.TclOOMMFRunner(oommf_tcl_path())
    assert isinstance(runner.errors(), str)
    check_runner(runner)

    # via runner object
    oc.runner.oommf_exe = "wrong_name"
    oc.runner.docker_exe = "wrong_name"
    monkeypatch.setenv("OOMMFTCL", oommf_tcl_path())
    oc.runner.autoselect_runner()
    runner = oc.runner.runner
    assert isinstance(runner, oo.TclOOMMFRunner)
    check_runner(runner)
    assert re.match(r"^TclOOMMFRunner\(.*\)$", repr(runner))
Ejemplo n.º 4
0
def test_status():
    assert oc.runner.runner.status == 0
    oc.runner._runner = oo.TclOOMMFRunner("wrong_name")  # force wrong runner
    assert oc.runner.runner.status == 1
    oc.runner.autoselect_runner()  # let oommfc find a correct runner
    assert oc.runner.runner.status == 0
Ejemplo n.º 5
0
def test_set_invalid_runner():
    with pytest.raises(ValueError):
        oc.runner.runner = oo.TclOOMMFRunner("wrong_name")
Ejemplo n.º 6
0
def test_set_tcl_oommf_runner():
    # assumes that conda is used to install oommf
    oc.runner.runner = oo.TclOOMMFRunner(oommf_tcl_path())
    assert isinstance(oc.runner.runner, oo.TclOOMMFRunner)