Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:50

0001 import unittest
0002 import os 
0003 import shutil
0004 
0005 from .tfile import TFileService
0006 import PhysicsTools.HeppyCore.framework.config as cfg
0007 
0008 class ServiceTestCase(unittest.TestCase):
0009 
0010     def test_tfile(self):
0011         config = cfg.Service(TFileService, 
0012                              'myhists', 
0013                              fname = 'histos.root', 
0014                              option = 'recreate')
0015         dummy = None
0016         dirname = 'test_dir'
0017         if os.path.exists(dirname):
0018             shutil.rmtree(dirname)
0019         os.mkdir(dirname)
0020         fileservice = TFileService(config, dummy, dirname)
0021         fileservice.start()
0022         fileservice.stop()
0023         shutil.rmtree(dirname)
0024 
0025 if __name__ == '__main__':
0026     unittest.main()