Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:29

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