Example #1
0
def _reset_data():
    print 'reset data'
    from wzdat.util import gen_dummydata, get_var_dir
    cfg = make_config()
    ddir = cfg['data_dir']

    # remove previous dummy data
    if os.path.isdir(ddir):
        print 'remove datadir'
        shutil.rmtree(ddir)

    # generate new dummy data
    gen_dummydata(ddir, 10, False)
    # make _var_ dir
    get_var_dir()
Example #2
0
def test_common_get_dir():
    d = get_var_dir()
    assert '_var_' in d
    assert os.path.isdir(d)

    d = get_tmp_dir()
    assert '_var_/tmp' in d
    assert os.path.isdir(d)

    d = get_hdf_dir()
    assert '_var_/hdf' in d
    assert os.path.isdir(d)

    d = get_hdf_dir()
    assert '_var_/hdf' in d
    assert os.path.isdir(d)

    d = get_cache_dir()
    assert '_var_/cache' in d
    assert os.path.isdir(d)

    d = get_conv_dir()
    assert '_var_/conv' in d
    assert os.path.isdir(d)