def test_6_update(self): """test that when something is changed, the unique id stays the same. """ dataset = Dataset(dataset_name_fccsw, xsection=1, cache=True) self.assertEqual(dataset.uid(), self.dataset.uid()) self.assertEqual(dataset.xsection(), 1) dataset = Dataset(dataset_name_fccsw, cache=True) self.assertEqual(dataset.xsection(), 1)
def test_1(self): """Test FCC component creation""" dset = Dataset(dataset_name_fccsw, cache=cache) comp = FCCComponent(dataset_name_fccsw, dataset_pattern_fccsw, xsection=dset.xsection()) self.assertListEqual(dset.list_of_good_files(), comp.files) self.assertEqual(dset.xsection(), comp.xSection) print comp
def test_1_publish(self): """Test that the publish script is working.""" xsection = random.uniform(0, 1) dsname = 'heppy/papas/ee_to_ZZ_condor_A_703' cmd = 'python publish.py {} -x {}'.format(dsname, xsection) os.system(cmd) dset = Dataset(dsname) self.assertAlmostEqual(dset.xsection(), xsection, places=7)
class FCCComponent(cfg.MCComponent): #---------------------------------------------------------------------- def __init__(self, name, pattern='*.root', cache=True, cfg=None, xsection=None, **kwargs): """""" self.dataset = Dataset(name, pattern, cache, cfg, xsection) super(FCCComponent, self).__init__(self.dataset.name, self.dataset.list_of_good_files(), xSection=self.dataset.xsection(), **kwargs)