annotate Tests/Run.py @ 437:e769bcf2b94f

added copyright UCLouvain
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Nov 2021 15:43:32 +0100
parents ad98466353c6
children 09ebdee8eda2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/usr/bin/python
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Orthanc - A Lightweight, RESTful DICOM Store
73
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 44
diff changeset
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 # Department, University Hospital of Liege, Belgium
363
79ce0f7a9714 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 342
diff changeset
6 # Copyright (C) 2017-2021 Osimis S.A., Belgium
437
e769bcf2b94f added copyright UCLouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 407
diff changeset
7 # Copyright (C) 2021-2021 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 #
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 # This program is free software: you can redistribute it and/or
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 # modify it under the terms of the GNU General Public License as
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 # published by the Free Software Foundation, either version 3 of the
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 # License, or (at your option) any later version.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 #
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 # This program is distributed in the hope that it will be useful, but
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 # General Public License for more details.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 #
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 import re
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 import sys
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 import argparse
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 import subprocess
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 import unittest
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
28 import pprint
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
30 from Tests import *
44
ffa542cce638 Toolbox.FindExecutable()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
31 import Toolbox
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 ##
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ## Parse the command-line arguments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 ##
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 parser = argparse.ArgumentParser(description = 'Run the integration tests on some instance of Orthanc.')
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 parser.add_argument('--server',
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
40 default = 'localhost',
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 help = 'Address of the Orthanc server to test')
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 parser.add_argument('--aet',
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 default = 'ORTHANC',
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 help = 'AET of the Orthanc instance to test')
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 parser.add_argument('--dicom',
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 type = int,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 default = 4242,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 help = 'DICOM port of the Orthanc instance to test')
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 parser.add_argument('--rest',
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 type = int,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 default = 8042,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 help = 'Port to the REST API')
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 parser.add_argument('--username',
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
54 default = 'alice',
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 help = 'Username to the REST API')
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 parser.add_argument('--password',
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
57 default = 'orthanctest',
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 help = 'Password to the REST API')
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
59 parser.add_argument('--force', help = 'Do not warn the user',
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
60 action = 'store_true')
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
61 parser.add_argument('--docker', help = 'These tests are run from Docker',
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
62 action = 'store_true')
342
bf8369ea3ff1 more tests of webdav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 306
diff changeset
63 parser.add_argument('--orthanc',
bf8369ea3ff1 more tests of webdav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 306
diff changeset
64 default = 'Orthanc',
bf8369ea3ff1 more tests of webdav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 306
diff changeset
65 help = 'Path to the executable of Orthanc')
6
6d645b3011e1 test_hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5
diff changeset
66 parser.add_argument('options', metavar = 'N', nargs = '*',
6d645b3011e1 test_hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5
diff changeset
67 help='Arguments to Python unittest')
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 args = parser.parse_args()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 if not args.force:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 print("""
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 WARNING: This test will remove all the content of your
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 Orthanc instance running on %s!
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 Are you sure ["yes" to go on]?""" % args.server)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 if sys.stdin.readline().strip() != 'yes':
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 print('Aborting...')
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 exit(0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 ##
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 ## Generate the configuration file for the anciliary instance of
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 ## Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 ##
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
21
2a29bcff60a7 tests of image decoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 13
diff changeset
89 CONFIG = '/tmp/IntegrationTestsConfiguration.json'
342
bf8369ea3ff1 more tests of webdav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 306
diff changeset
90 subprocess.check_call([ Toolbox.FindExecutable(args.orthanc),
44
ffa542cce638 Toolbox.FindExecutable()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
91 '--config=%s' % CONFIG ])
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
93 with open(CONFIG, 'rt') as f:
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 config = f.read()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
30
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
96 if args.docker and args.server == 'localhost':
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
97 args.server = GetDockerHostAddress()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
98
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 config = re.sub(r'("StorageDirectory"\s*:)\s*".*?"', r'\1 "/tmp/OrthancStorage"', config)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 config = re.sub(r'("IndexDirectory"\s*:)\s*".*?"', r'\1 "/tmp/OrthancStorage"', config)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 config = re.sub(r'("DicomAet"\s*:)\s*".*?"', r'\1 "ORTHANCTEST"', config)
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
102 config = re.sub(r'("DicomPort"\s*:)\s*.*?,', r'\1 5001,', config)
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
103 config = re.sub(r'("HttpPort"\s*:)\s*.*?,', r'\1 5000,', config)
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 config = re.sub(r'("RemoteAccessAllowed"\s*:)\s*false', r'\1 true', config)
407
ad98466353c6 test_modify_subsequences
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
105 config = re.sub(r'("AuthenticationEnabled"\s*:)\s*false,', r'', config) # Set with "RegisteredUsers"
ad98466353c6 test_modify_subsequences
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
106 config = re.sub(r'("RegisteredUsers"\s*:)\s*{', r'"AuthenticationEnabled" : true, \1 { "alice" : "orthanctest"', config)
ad98466353c6 test_modify_subsequences
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 378
diff changeset
107 config = re.sub(r'("ExecuteLuaEnabled"\s*:)\s*false', r'\1 true', config)
35
f2dcf96fec51 parameter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
108 config = re.sub(r'("HttpCompressionEnabled"\s*:)\s*true', r'\1 false', config)
21
2a29bcff60a7 tests of image decoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 13
diff changeset
109 config = re.sub(r'("DicomAssociationCloseDelay"\s*:)\s*[0-9]*', r'\1 0', config)
107
fddb35f7289d test_bitbucket_issue_44
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 100
diff changeset
110 config = re.sub(r'("DicomModalities"\s*:)\s*{', r'\1 { "orthanc" : [ "%s", "%s", %s ]' %
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 (args.aet, args.server, args.dicom), config)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
289
4a70411ac9ad test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 260
diff changeset
113 # New to test transcoding over DICOM (1.7.0)
4a70411ac9ad test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 260
diff changeset
114 config = re.sub(r'("RleTransferSyntaxAccepted"\s*:)\s*true', r'\1 false', config)
4a70411ac9ad test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 260
diff changeset
115
4a70411ac9ad test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 260
diff changeset
116
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
117 with open(CONFIG, 'wt') as f:
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
118 f.write(config)
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
119
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 localOrthanc = ExternalCommandThread([
342
bf8369ea3ff1 more tests of webdav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 306
diff changeset
121 Toolbox.FindExecutable(args.orthanc),
bf8369ea3ff1 more tests of webdav
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 306
diff changeset
122 CONFIG,
294
192665e6113f instruction to run on Windows (with WSL)
Alain Mazy <alain@mazy.be>
parents: 289
diff changeset
123 #'--verbose',
192665e6113f instruction to run on Windows (with WSL)
Alain Mazy <alain@mazy.be>
parents: 289
diff changeset
124 #'--no-jobs'
27
cde1691838d3 wildcard test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 21
diff changeset
125 #'/home/jodogne/Subversion/Orthanc/i/Orthanc', CONFIG, '--verbose'
cde1691838d3 wildcard test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 21
diff changeset
126 ])
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
129 LOCAL = DefineOrthanc(aet = 'ORTHANCTEST',
30
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
130 server = 'localhost',
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
131 dicomPort = 5001,
13
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
132 restPort = 5000,
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
133 username = 'alice',
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
134 password = 'orthanctest')
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
135
13
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
136 REMOTE = DefineOrthanc(server = args.server,
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 username = args.username,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 password = args.password,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 aet = args.aet,
13
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
140 dicomPort = args.dicom,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
141 restPort = args.rest)
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
8
f8d781d1d267 test_changes, test_archive, test_media_archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 6
diff changeset
145 print('Parameters of the instance of Orthanc being tested:')
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
146 pprint.pprint(REMOTE)
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
147 print('')
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
150 print('Waiting for the internal Orthanc to start...')
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
151 while True:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
152 try:
44
ffa542cce638 Toolbox.FindExecutable()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
153 Toolbox.DoGet(LOCAL, '/instances')
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
154 break
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
155 except:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
156 time.sleep(0.1)
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 try:
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
160 print('\nStarting the tests...')
306
da2be3ff2db5 fix getscu binaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 294
diff changeset
161 SetOrthancParameters(LOCAL, REMOTE, args.docker)
83
3f2170efa8d2 patches for python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
162
378
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
163 # Change the order of the tests
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
164 # https://stackoverflow.com/a/4006044/881731
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
165 # https://stackoverflow.com/a/54923706/881731
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
166
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
167 # Reverse order
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
168 # unittest.TestLoader.sortTestMethodsUsing = lambda _, x, y: cmp(y, x)
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
169
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
170 # import random
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
171 # random.seed(25)
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
172 # unittest.TestLoader.sortTestMethodsUsing = lambda self, a, b: random.choice([1, 0, -1])
a4b8450a1158 fix test_storescu_transcoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 363
diff changeset
173
6
6d645b3011e1 test_hierarchy
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5
diff changeset
174 unittest.main(argv = [ sys.argv[0] ] + args.options)
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175
83
3f2170efa8d2 patches for python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 73
diff changeset
176
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 finally:
3
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
178 print('\nDone')
2dbba2e6aa4b reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
179
1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 # The tests have stopped or "Ctrl-C" has been hit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 try:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 localOrthanc.stop()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 except:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 pass