src
PhysicsTools
HeppyCore
python
framework
services
service_test.py
Go to the documentation of this file.
1
from
__future__
import
absolute_import
2
import
unittest
3
import
os
4
import
shutil
5
6
from
.tfile
import
TFileService
7
import
PhysicsTools.HeppyCore.framework.config
as
cfg
8
9
class
ServiceTestCase
(unittest.TestCase):
10
11
def
test_tfile
(self):
12
config = cfg.Service(TFileService,
13
'myhists'
,
14
fname =
'histos.root'
,
15
option =
'recreate'
)
16
dummy =
None
17
dirname =
'test_dir'
18
if
os.path.exists(dirname):
19
shutil.rmtree(dirname)
20
os.mkdir(dirname)
21
fileservice =
TFileService
(config, dummy, dirname)
22
fileservice.start()
23
fileservice.stop()
24
shutil.rmtree(dirname)
25
26
if
__name__ ==
'__main__'
:
27
unittest.main()
service_test.ServiceTestCase.test_tfile
def test_tfile(self)
Definition:
service_test.py:11
service_test.ServiceTestCase
Definition:
service_test.py:9
tfile.TFileService
Definition:
tfile.py:4
Generated for CMSSW Reference Manual by
1.8.14