~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to tests/unit_tests/various/test_cmd.py

  • Committer: olivier-mattelaer
  • Date: 2020-08-21 09:16:56 UTC
  • mfrom: (284.2.24 python3)
  • Revision ID: olivier-mattelaer-20200821091656-iizux2mj94tkssuo
pass to 2.8.0 (and move to python3 branch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#
14
14
################################################################################
15
15
 
 
16
from __future__ import absolute_import
 
17
from __future__ import print_function
16
18
import os
17
19
 
18
20
from madgraph import MG5DIR
26
28
    def test_install_update(self):
27
29
        """Check that the install update command point to the official link
28
30
        and not to the test one."""
29
 
        check1 = "            filetext = urllib.urlopen('http://madgraph.phys.ucl.ac.be/mg5amc_build_nb')\n"
30
 
        check2 = "                    filetext = urllib.urlopen('http://madgraph.phys.ucl.ac.be/patch/build%s.patch' %(i+1))\n" 
 
31
        check1 = "            filetext = six.moves.urllib.request.urlopen('http://madgraph.phys.ucl.ac.be/mg5amc_build_nb')\n"
 
32
        check2 = "                    filetext = six.moves.urllib.request.urlopen('http://madgraph.phys.ucl.ac.be/patch/build%s.patch' %(i+1))\n" 
31
33
        
32
34
        has1, has2 = False, False
33
35
        for line in  open(os.path.join(MG5DIR,'madgraph','interface',
49
51
        if not os.path.exists(pjoin(MG5DIR, 'input','mg5_configuration.txt')):
50
52
            return        
51
53
        
52
 
        text1 = file(pjoin(MG5DIR,'input','.mg5_configuration_default.txt')).read()
53
 
        text2 = file(pjoin(MG5DIR,'input','mg5_configuration.txt')).read()
 
54
        text1 = open(pjoin(MG5DIR,'input','.mg5_configuration_default.txt')).read()
 
55
        text2 = open(pjoin(MG5DIR,'input','mg5_configuration.txt')).read()
54
56
        warning = """WARNING: Your file mg5_configuration.txt and .mg5_configuration_default.txt
55
57
        are different. This probably fine but please check it before any release."""
56
58
        if text1 != text2:
57
 
            print warning
 
59
            print(warning)
58
60
        
 
 
b'\\ No newline at end of file'