~maddevelopers/mg5amcnlo/3.0.1

« back to all changes in this revision

Viewing changes to tests/acceptance_tests/test_cmd.py

  • Committer: Marco Zaro
  • Date: 2014-01-27 16:54:10 UTC
  • mfrom: (78.124.55 MG5_aMC_2.1)
  • Revision ID: marco.zaro@gmail.com-20140127165410-5lma8c2hzbzm426j
merged with lp:~maddevelopers/madgraph5/MG5_aMC_2.1 r 267

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
################################################################################
2
2
#
3
 
# Copyright (c) 2009 The MadGraph Development team and Contributors
 
3
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
4
4
#
5
 
# This file is a part of the MadGraph 5 project, an application which 
 
5
# This file is a part of the MadGraph5_aMC@NLO project, an application which 
6
6
# automatically generates Feynman diagrams and matrix elements for arbitrary
7
7
# high-energy processes in the Standard Model and beyond.
8
8
#
9
 
# It is subject to the MadGraph license which should accompany this 
 
9
# It is subject to the MadGraph5_aMC@NLO license which should accompany this 
10
10
# distribution.
11
11
#
12
 
# For more information, please visit: http://madgraph.phys.ucl.ac.be
 
12
# For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch
13
13
#
14
14
################################################################################
15
15
import subprocess
109
109
    def test_config(self):
110
110
        """check that configuration file is at default value"""
111
111
        self.maxDiff=None
 
112
        self.cmd.options = {} #reset to None
112
113
        config = self.cmd.set_configuration(MG5DIR+'/input/.mg5_configuration_default.txt', final=False)
113
114
        config =dict(config)
114
115
        del config['stdout_level']
115
 
        for key in config.keys():
116
 
            if key.endswith('_path') and key != 'cluster_temp_path':
117
 
                del config[key]
 
116
#        for key in config.keys():
 
117
#            if key.endswith('_path') and key != 'cluster_temp_path':
 
118
#                del config[key]
118
119
        expected = {'web_browser': None, 
119
120
                    'text_editor': None, 
120
121
                    'cluster_queue': None,
121
122
                    'nb_core': None,
122
123
                    'run_mode': 2,
123
 
#                    'pythia-pgs_path': './pythia-pgs', 
124
 
#                    'td_path': './td', 
125
 
#                    'delphes_path': './Delphes', 
 
124
                    'pythia-pgs_path': './pythia-pgs', 
 
125
                    'td_path': './td', 
 
126
                    'delphes_path': './Delphes', 
126
127
                    'cluster_type': 'condor', 
127
 
#                    'madanalysis_path': './MadAnalysis',
128
 
                    'cluster_temp_path': None,
129
128
                    'cluster_status_update': (600, 30),
 
129
                    'madanalysis_path': './MadAnalysis', 
 
130
                    'cluster_temp_path': None, 
130
131
                    'fortran_compiler': None, 
131
 
#                    'exrootanalysis_path': './ExRootAnalysis', 
 
132
                    'exrootanalysis_path': './ExRootAnalysis', 
132
133
                    'eps_viewer': None, 
133
134
                    'automatic_html_opening': True, 
134
 
#                    'pythia8_path': None,
 
135
                    'pythia8_path': './pythia8',
135
136
                    'group_subprocesses': 'Auto',
136
137
                    'complex_mass_scheme': False,
137
138
                    'gauge': 'unitary',
141
142
                    'timeout': 60,
142
143
                    'ignore_six_quark_processes': False,
143
144
                    'OLP': 'MadLoop',
144
 
                    'auto_update': 7
 
145
                    'auto_update': 7,
 
146
                    'cluster_nb_retry': 1,
 
147
                    'cluster_retry_wait': 300,
 
148
                    'syscalc_path':'./SysCalc',
 
149
                    'hepmc_path': './hepmc',
 
150
                    'hwpp_path': './herwigPP',
 
151
                    'thepeg_path': './thepeg'
145
152
                    }
146
153
 
147
154
        self.assertEqual(config, expected)
316
323
        self.assertRaises(InvalidCmd,
317
324
                          self.do, 'output')
318
325
 
 
326
    def test_check_generate_optimize(self):
 
327
        """Test that errors are raised appropriately for output"""
 
328
 
 
329
        # Invalid since forbiddent by the optimize option
 
330
        self.assertRaises(InvalidCmd,
 
331
                          self.do, 'generate a > e+ e- --optimize')
 
332
 
 
333
        self.assertRaises(InvalidCmd,
 
334
                          self.do, 'generate b > t w- --optimize')
 
335
 
 
336
        # Invalid since optimize is not allowed for cross-section
 
337
        self.assertRaises(InvalidCmd,
 
338
                          self.do, 'generate  p p > e+ e- --optimize') 
 
339
        
 
340
        # check that --optimize filter correctly
 
341
        self.do('generate t > all all --optimize')
 
342
        self.assertEqual(len(self.cmd._curr_amps), 1)
 
343
              
 
344
               
 
345
 
319
346
    def test_read_madgraph4_proc_card(self):
320
347
        """Test reading a madgraph4 proc_card.dat"""
321
348
        os.system('cp -rf %s %s' % (os.path.join(MG5DIR,'Template','LO'),
999
1026
        self.assertEqual(open(os.path.join(self.out_dir,
1000
1027
                                           'SubProcesses',
1001
1028
                                           'P0_qq_gogo_go_qqn1_go_qqn1',
1002
 
                                           'symfact_orig.dat')).read(),
1003
 
                         """ 1    1
1004
 
 2    -1
1005
 
 3    -1
1006
 
 4    -1
1007
 
 5    1
1008
 
 6    -5
1009
 
 7    -5
1010
 
 8    -5
1011
 
 9    1
1012
 
 10   -9
1013
 
 11   -9
1014
 
 12   -9
1015
 
""")
 
1029
                                           'symfact_orig.dat')).read().split('\n'),
 
1030
                         """ 1   1
 
1031
 2  -1
 
1032
 3  -1
 
1033
 4  -1
 
1034
 5   1
 
1035
 6  -5
 
1036
 7  -5
 
1037
 8  -5
 
1038
 9   1
 
1039
10  -9
 
1040
11  -9
 
1041
12  -9
 
1042
""".split('\n'))
1016
1043
 
1017
1044
        # Compile the Source directory
1018
1045
        status = subprocess.call(['make'],