12 self.assertEqual(hpstr.name,
'hpstr')
13 self.assertEqual(hpstr.command,
'hpstr')
14 self.assertEqual(hpstr.is_data, 0)
18 self.assertEqual(hpstr.required_parameters(), [
'config_files'])
22 self.assertEqual(hpstr.optional_parameters(), [
'year',
'is_data',
'nevents',
'tracking'])
26 self.assertEqual(hpstr.required_config(), [
'hpstr_install_dir',
'hpstr_base'])
29 hpstr =
HPSTR(cfg=
'config', inputs=[
'some/path/to/input.root'], outputs=[
'some/path/to/output.root'])
30 parser = configparser.ConfigParser()
31 config_file = [
'test_helpers/.hpsmc_test_cfg']
32 parser.read(config_file)
34 params = {
'config_files': {
'config':
'config.py'}}
35 hpstr.set_parameters(params)
38 self.assertEqual(hpstr.env_script,
'test_helpers/hpstrdir/install/bin/hpstr-env.sh')
39 self.assertEqual(hpstr.cfg_path,
'test_helpers/hpstrdir/processors/config/config.py')
40 self.assertEqual(hpstr.append_tok,
'config')
43 hpstr =
HPSTR(cfg=
'appended_config', inputs=[
'some/path/to/input.root'], outputs=[
'some/path/to/output.root'])
44 parser = configparser.ConfigParser()
45 config_file = [
'test_helpers/.hpsmc_test_cfg']
46 parser.read(config_file)
48 params = {
'config_files': {
'appended_config':
'config.py'}}
49 hpstr.set_parameters(params)
51 self.assertEqual(hpstr.output_files(), [
'some/path/to/input_appended_config.root'])
54 hpstr =
HPSTR(cfg=
'appended_config', inputs=[
'some/path/to/input.slcio'], outputs=[
'some/path/to/output.root'])
55 parser = configparser.ConfigParser()
56 config_file = [
'test_helpers/.hpsmc_test_cfg']
57 parser.read(config_file)
59 params = {
'config_files': {
'appended_config':
'config.py'}}
60 hpstr.set_parameters(params)
62 self.assertEqual(hpstr.output_files(), [
'some/path/to/input.root'])
65 hpstr =
HPSTR(cfg=
'config', inputs=[
'some/path/to/input.root'], outputs=[
'some/path/to/output.root'])
67 parser = configparser.ConfigParser()
68 config_file = [
'test_helpers/.hpsmc_test_cfg']
69 parser.read(config_file)
71 params = {
'config_files': {
'config':
'config.py'},
'nevents': 1000,
'year': 10}
72 hpstr.set_parameters(params)
75 self.assertEqual(hpstr.cmd_args(), [
"test_helpers/hpstrdir/processors/config/config.py",
"-t",
"0",
"-i",
"some/path/to/input.root",
"-o",
"some/path/to/input_config.root",
"-n",
"1000",
"-y",
"10"])
78 if __name__ ==
'__main__':