# HG changeset patch # User Sebastien Jodogne # Date 1600255272 -7200 # Node ID 96718de2f29cfb53c3fe3c9b6decbc1d153a848b # Parent 971ff285302b67bc7eb48eccec1ec0885290bb2d simplification and fix of test_incoming_findscu diff -r 971ff285302b -r 96718de2f29c GenerateConfigurationForTests.py --- a/GenerateConfigurationForTests.py Tue Sep 15 16:04:48 2020 +0200 +++ b/GenerateConfigurationForTests.py Wed Sep 16 13:21:12 2020 +0200 @@ -140,6 +140,7 @@ config['SaveJobs'] = False config['ExecuteLuaEnabled'] = True config['HttpTimeout'] = 2 +config['SyncStorageArea'] = False # For tests to run more quickly del config['KeepAlive'] config['Dictionary'] = { diff -r 971ff285302b -r 96718de2f29c Tests/Tests.py --- a/Tests/Tests.py Tue Sep 15 16:04:48 2020 +0200 +++ b/Tests/Tests.py Wed Sep 16 13:21:12 2020 +0200 @@ -1185,7 +1185,7 @@ self.assertTrue('20070208' in series) self.assertTrue('19980312' in series) - i = CallFindScu([ '-k', '0008,0052=SERIES', '-k', '0008,0021', '-k', 'ModalitiesInStudy=MR\\XA' ]) + i = CallFindScu([ '-k', '0008,0052=SERIES', '-k', '0008,0021', '-k', 'Modality=MR\\XA' ]) series = re.findall('\(0008,0021\).*?\[\s*(.*?)\s*\]', i) self.assertEqual(1, len(series)) self.assertTrue('19980312' in series) @@ -5991,24 +5991,24 @@ UploadInstance(_REMOTE, 'Comunix/Ct/IM-0001-0001.dcm') UploadInstance(_REMOTE, 'Comunix/Pet/IM-0001-0001.dcm') - a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Study', - 'Query' : { 'ModalitiesInStudy' : 'UX' }}) - self.assertEqual(0, len(a)) - - for i in [ '', 'PT', 'CT\\PT', 'UX\\PT', 'CT\\PT' ]: - # The empty string '' corresponds to universal matching + i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', '0020,000d=', '-k', '0008,0061=' ]) + modalitiesInStudy = re.findall('\(0008,0061\).*?\[(.*?)\]', i) + self.assertEqual(1, len(modalitiesInStudy)) + self.assertEqual('CT\\PT ', modalitiesInStudy[0]) + + for i in [ '', 'CT', 'PT', 'UX', 'UX\\MR', 'CT\\PT', 'UX\\PT', 'CT\\PT', 'UX\\CT\\PT' ]: + # The empty string '' corresponds to universal matching. + # The case where "i == 'CT'" failed in Orthanc <= 1.7.3. + + if i in [ 'UX', 'UX\\MR' ]: + expected = 0 + else: + expected = 1 + a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Study', 'Query' : { 'ModalitiesInStudy' : i }}) - self.assertEqual(1, len(a)) + self.assertEqual(expected, len(a)) i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', '0020,000d=', '-k', '0008,0061=%s' % i ]) studyInstanceUid = re.findall('\(0020,000d\).*?\[(.*?)\]', i) - self.assertEqual(1, len(studyInstanceUid)) - - a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Study', - 'Query' : { 'ModalitiesInStudy' : 'CT' }}) - self.assertEqual(1, len(a)) # Fails in Orthanc <= 1.7.3 - - i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', '0020,000d=', '-k', '0008,0061=CT' ]) - studyInstanceUid = re.findall('\(0020,000d\).*?\[(.*?)\]', i) - self.assertEqual(1, len(studyInstanceUid)) # Fails in Orthanc <= 1.7.3 + self.assertEqual(expected, len(studyInstanceUid))