HPS-MC
Loading...
Searching...
No Matches
test_tools_lciodumpevent.py
Go to the documentation of this file.
1
import
unittest
2
import
configparser
3
4
from
hpsmc.tools
import
LCIODumpEvent
5
6
7
class
TestLCIODumpEvent
(unittest.TestCase):
8
9
def
test_init
(self):
10
lcio_dump_event =
LCIODumpEvent
(event_num=10)
11
self.assertEqual(lcio_dump_event.name,
"lcio_dump_event"
)
12
self.assertEqual(lcio_dump_event.command,
"dumpevent"
)
13
self.assertEqual(lcio_dump_event.event_num, 10)
14
15
def
test_required_params
(self):
16
lcio_dump_event =
LCIODumpEvent
()
17
self.assertEqual(lcio_dump_event.required_parameters(), [])
18
19
def
test_required_config
(self):
20
lcio_dump_event =
LCIODumpEvent
()
21
self.assertEqual(lcio_dump_event.required_config(), [
"lcio_dir"
])
22
23
def
test_config
(self):
24
lcio_dump_event =
LCIODumpEvent
()
25
parser = configparser.ConfigParser()
26
config_file = [
'test_helpers/.hpsmc_test_cfg'
]
27
parser.read(config_file)
28
lcio_dump_event.config(parser)
29
self.assertEqual(lcio_dump_event.lcio_dir,
"test_helpers/lciodir"
)
30
31
def
test_setup
(self):
32
lcio_dump_event =
LCIODumpEvent
()
33
parser = configparser.ConfigParser()
34
config_file = [
'test_helpers/.hpsmc_test_cfg'
]
35
parser.read(config_file)
36
lcio_dump_event.config(parser)
37
lcio_dump_event.setup()
38
self.assertEqual(lcio_dump_event.command,
"test_helpers/lciodir/bin/dumpevent"
)
39
40
def
test_cmd_args
(self):
41
lcio_dump_event =
LCIODumpEvent
(event_num=10, inputs=[
"some/path/to/input.slcio"
])
42
parser = configparser.ConfigParser()
43
config_file = [
'test_helpers/.hpsmc_test_cfg'
]
44
parser.read(config_file)
45
lcio_dump_event.config(parser)
46
self.assertEqual(lcio_dump_event.cmd_args(), [
"some/path/to/input.slcio"
,
"10"
])
47
48
49
if
__name__ ==
'__main__'
:
50
unittest.main()
hpsmc.tools.LCIODumpEvent
Dump LCIO event information.
Definition
tools.py:1246
test.test_tools_lciodumpevent.TestLCIODumpEvent
Definition
test_tools_lciodumpevent.py:7
test.test_tools_lciodumpevent.TestLCIODumpEvent.test_required_params
test_required_params(self)
Definition
test_tools_lciodumpevent.py:15
test.test_tools_lciodumpevent.TestLCIODumpEvent.test_required_config
test_required_config(self)
Definition
test_tools_lciodumpevent.py:19
test.test_tools_lciodumpevent.TestLCIODumpEvent.test_cmd_args
test_cmd_args(self)
Definition
test_tools_lciodumpevent.py:40
test.test_tools_lciodumpevent.TestLCIODumpEvent.test_init
test_init(self)
Definition
test_tools_lciodumpevent.py:9
test.test_tools_lciodumpevent.TestLCIODumpEvent.test_config
test_config(self)
Definition
test_tools_lciodumpevent.py:23
test.test_tools_lciodumpevent.TestLCIODumpEvent.test_setup
test_setup(self)
Definition
test_tools_lciodumpevent.py:31
hpsmc.tools
Tools that can be used in HPSMC jobs.
Definition
tools.py:1
python
test
test_tools_lciodumpevent.py
Generated by
1.9.8