def test_path2rootdir(self): path_dicts = make_paths(read_yaml(self.yamlfile)) for path in path_dicts: rfile, rdir = path2rootdir(path['path']) self.assertTrue(not rfile.IsZombie()) self.assertTrue(rdir)
from utils import read_yaml, make_paths, path2rootdir from pprint import pprint d = read_yaml('dsk_train_out.yaml') allp = make_paths(d) pprint(allp) from ROOT import TFile dirs = [] for path in allp: rfile, rdir = path2rootdir(path['path']) dirs.append(rdir) print dirs # for d in dirs: # d.ls() # t = path2rootdir('dsk_train_out.root')