diff Plugins/DicomWeb/Run.py @ 321:3c8c6b41eec4

dealing with Content-Location in test_frames_transcoding of DICOMweb
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 22 Jul 2020 10:33:53 +0200
parents de6e73e4df60
children b7c2fb8e1b57
line wrap: on
line diff
--- a/Plugins/DicomWeb/Run.py	Wed Jul 08 13:31:03 2020 +0200
+++ b/Plugins/DicomWeb/Run.py	Wed Jul 22 10:33:53 2020 +0200
@@ -1166,7 +1166,7 @@
             '1.2.840.10008.1.2.4.70' : 'multipart/related; type=image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.70',
             }
 
-        uri = '/dicom-web%s' % UploadAndGetWadoPath('TransferSyntaxes/1.2.840.10008.1.2.4.50.dcm')
+        uri = 'dicom-web%s' % UploadAndGetWadoPath('TransferSyntaxes/1.2.840.10008.1.2.4.50.dcm')
         truth = Image.open(GetDatabasePath('TransferSyntaxes/1.2.840.10008.1.2.4.50.png'))
         
         a = DoGetMultipart(ORTHANC, '%s/frames/1' % uri,
@@ -1174,7 +1174,7 @@
                            returnHeaders = True)
         self.assertEqual(1, len(a))
         self.assertEqual(2, len(a[0]))
-        self.assertEqual('http://localhost:8042%s/frames/1' % uri,
+        self.assertEqual('%s%s/frames/1' % (ORTHANC['Url'], uri),
                          a[0][1]['Content-Location'])
         self.assertEqual(ACCEPT['1.2.840.10008.1.2.4.50'],
                          'multipart/related; type=%s' % a[0][1]['Content-Type'])
@@ -1234,14 +1234,14 @@
             self.assertEqual(RESULTS[syntax], ComputeMD5(a[0]))
 
         # Test transcoding to all the possible transfer syntaxes
-        uri = '/dicom-web%s' % UploadAndGetWadoPath('KarstenHilbertRF.dcm')
+        uri = 'dicom-web%s' % UploadAndGetWadoPath('KarstenHilbertRF.dcm')
         for syntax in ACCEPT2:
             a = DoGetMultipart(ORTHANC, '%s/frames/1' % uri,
                                headers = { 'Accept' : ACCEPT2[syntax] },
                                returnHeaders = True)
             self.assertEqual(1, len(a))
             self.assertEqual(2, len(a[0]))
-            self.assertEqual('http://localhost:8042%s/frames/1' % uri,
+            self.assertEqual('%s%s/frames/1' % (ORTHANC['Url'], uri),
                              a[0][1]['Content-Location'])
             self.assertEqual(ACCEPT[syntax],
                              'multipart/related; type=%s' % a[0][1]['Content-Type'])