Ejemplo n.º 1
0
def test_inicase_pwd_basepath(fmurun, globalconfig2):

    logger.info("Active folder is %s", fmurun)
    os.chdir(fmurun)

    icase = InitializeCase(config=globalconfig2, verbosity="INFO")
    with pytest.warns(UserWarning):
        icase._establish_pwd_casepath()

    logger.info("Casepath is %s", icase._casepath)

    assert icase._casepath == fmurun.parent.parent
    assert icase._pwd == fmurun
Ejemplo n.º 2
0
def test_inicase_pwd_basepath_explicit(fmurun, globalconfig2):
    """The casepath should in general be explicit."""
    logger.info("Active folder is %s", fmurun)
    os.chdir(fmurun)

    myroot = fmurun

    icase = InitializeCase(config=globalconfig2,
                           verbosity="INFO",
                           rootfolder=myroot,
                           casename="mycase")
    icase._establish_pwd_casepath()

    logger.info("Casepath is %s", icase._casepath)

    assert icase._casepath == myroot
    assert icase._pwd == fmurun