comparison GenerateConfigurationForTests.py @ 82:91e2ed032f96

fix test
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 Jun 2016 16:33:42 +0200
parents 97acfdf0dbce
children 4b24faec842b
comparison
equal deleted inserted replaced
81:5920954287dd 82:91e2ed032f96
41 action = 'store_true') 41 action = 'store_true')
42 42
43 parser.add_argument('--plugins', 43 parser.add_argument('--plugins',
44 help = 'Add a path to a folder containing plugins') 44 help = 'Add a path to a folder containing plugins')
45 45
46 parser.add_argument('--dicom',
47 type = int,
48 default = 4242,
49 help = 'DICOM port of the Orthanc server')
50
46 args = parser.parse_args() 51 args = parser.parse_args()
47 52
48 53
49 ## 54 ##
50 ## Check whether the file can be overwritten 55 ## Check whether the file can be overwritten
73 78
74 with open(args.target, 'r') as f: 79 with open(args.target, 'r') as f:
75 config = f.read() 80 config = f.read()
76 81
77 config = re.sub(r'("DicomAet"\s*:)\s*".*?"', r'\1 "ORTHANC"', config) 82 config = re.sub(r'("DicomAet"\s*:)\s*".*?"', r'\1 "ORTHANC"', config)
83 config = re.sub(r'("DicomPort"\s*:)\s*.*?,', r'\1 %d,' % args.dicom, config)
78 config = re.sub(r'("RemoteAccessAllowed"\s*:)\s*false', r'\1 true', config) 84 config = re.sub(r'("RemoteAccessAllowed"\s*:)\s*false', r'\1 true', config)
79 config = re.sub(r'("AuthenticationEnabled"\s*:)\s*false', r'\1 true', config) 85 config = re.sub(r'("AuthenticationEnabled"\s*:)\s*false', r'\1 true', config)
80 config = re.sub(r'("DicomAssociationCloseDelay"\s*:)\s*[0-9]*', r'\1 0', config) 86 config = re.sub(r'("DicomAssociationCloseDelay"\s*:)\s*[0-9]*', r'\1 0', config)
81 config = re.sub(r'("DefaultEncoding"\s*:)\s*".*?"', r'\1 "Windows1251"', config) # For test_issue_32 87 config = re.sub(r'("DefaultEncoding"\s*:)\s*".*?"', r'\1 "Windows1251"', config) # For test_issue_32
82 config = re.sub(r'("RegisteredUsers"\s*:)\s*{', r'\1 { "alice" : "orthanctest"', config) 88 config = re.sub(r'("RegisteredUsers"\s*:)\s*{', r'\1 { "alice" : "orthanctest"', config)
87 config = re.sub(r'("HttpCompressionEnabled"\s*:)\s*true', r'\1 false', config) 93 config = re.sub(r'("HttpCompressionEnabled"\s*:)\s*true', r'\1 false', config)
88 94
89 # Enable case-insensitive PN (the default on versions <= 0.8.6) 95 # Enable case-insensitive PN (the default on versions <= 0.8.6)
90 config = re.sub(r'("CaseSensitivePN"\s*:)\s*true', r'\1 false', config) 96 config = re.sub(r'("CaseSensitivePN"\s*:)\s*true', r'\1 false', config)
91 97
98 config = re.sub(r'("AllowFindSopClassesInStudy"\s*:)\s*false', r'\1 true', config)
99
100
92 if args.plugins != None: 101 if args.plugins != None:
93 config = re.sub(r'("Plugins"\s*:\s*\[)', r'\1 "%s"' % args.plugins, config) 102 config = re.sub(r'("Plugins"\s*:\s*\[)', r'\1 "%s"' % args.plugins, config)
94 103
95 104
96 with open(args.target, 'wt') as f: 105 with open(args.target, 'wt') as f: