changeset 561:2c809c605592

conditional tests
author Alain Mazy <am@osimis.io>
date Wed, 28 Jun 2023 16:43:59 +0200
parents 0ad170c7b6c8
children a6fb40c2b722
files Plugins/DicomWeb/Run.py
diffstat 1 files changed, 15 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/DicomWeb/Run.py	Wed Jun 28 10:38:35 2023 +0200
+++ b/Plugins/DicomWeb/Run.py	Wed Jun 28 16:43:59 2023 +0200
@@ -1708,21 +1708,22 @@
         self.assertEqual(1, len(m))
         self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
 
-        # This fails on DICOMweb <= 1.13 because of the "; q=.2",
-        # since multiple accepts were not supported
-        # https://bugs.orthanc-server.com/show_bug.cgi?id=216
-        m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
-            'accept': 'text/html, image/gif, image/jpeg, */*; q=.2, */*; q=.2'
-        })
-        self.assertEqual(1, len(m))
-        self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
+        if IsPluginVersionAbove(ORTHANC, "dicom-web", 1, 13, 1) and IsOrthancVersionAbove(ORTHANC, 1, 12, 1):
+            # This fails on DICOMweb <= 1.13 because of the "; q=.2",
+            # since multiple accepts were not supported
+            # https://bugs.orthanc-server.com/show_bug.cgi?id=216
+            m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
+                'accept': 'text/html, image/gif, image/jpeg, */*; q=.2, */*; q=.2'
+            })
+            self.assertEqual(1, len(m))
+            self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
 
-        # This fails on Orthanc <= 1.12.0 because of the ";q=0.9"
-        m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
-            'accept': 'text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8'
-        })
-        self.assertEqual(1, len(m))
-        self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
+            # This fails on Orthanc <= 1.12.0 because of the ";q=0.9"
+            m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
+                'accept': 'text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8'
+            })
+            self.assertEqual(1, len(m))
+            self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
 
 
     def test_accept_negotiation(self):