# HG changeset patch # User Alain Mazy # Date 1687963439 -7200 # Node ID 2c809c605592cb2b9342e42a96fec6781f6f07d1 # Parent 0ad170c7b6c829bdd3945ce5e9c0e16dfd0fcb75 conditional tests diff -r 0ad170c7b6c8 -r 2c809c605592 Plugins/DicomWeb/Run.py --- 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):