comparison Plugins/DicomWeb/Run.py @ 551:c8d2775f0d02

added test_issue_216 for DICOMweb
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Jun 2023 19:17:03 +0200
parents bcd87bf59630
children 71096a3e3006
comparison
equal deleted inserted replaced
550:a8f6e641e087 551:c8d2775f0d02
1689 'X-Forwarded-Proto': 'https' 1689 'X-Forwarded-Proto': 'https'
1690 }) 1690 })
1691 self.assertIn("https://my-domain/dicom-web", m[0][u'7FE00010']['BulkDataURI']) 1691 self.assertIn("https://my-domain/dicom-web", m[0][u'7FE00010']['BulkDataURI'])
1692 1692
1693 1693
1694 def test_issue_216(self):
1695 study = UploadInstance(ORTHANC, 'ColorTestImageJ.dcm')['ParentStudy']
1696 studyUid = DoGet(ORTHANC, '/studies/%s' % study)['MainDicomTags']['StudyInstanceUID']
1697
1698 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1699 'accept': 'image/webp, */*;q=0.8, text/html, application/xhtml+xml, application/xml;q=0.9'
1700 })
1701 self.assertEqual(1, len(m))
1702 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1703
1704 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1705 'accept': 'text/html, application/xhtml+xml, application/xml, image/webp, */*;q=0.8'
1706 })
1707 self.assertEqual(1, len(m))
1708 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1709
1710 # This fails on Orthanc <= 1.12.0 because of the "; q=.2"
1711 # https://bugs.orthanc-server.com/show_bug.cgi?id=216
1712 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1713 'accept': 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2'
1714 })
1715 self.assertEqual(1, len(m))
1716 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1717
1718 # This fails on Orthanc <= 1.12.0 because of the ";q=0.9"
1719 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1720 'accept': 'text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8'
1721 })
1722 self.assertEqual(1, len(m))
1723 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1724
1725
1694 try: 1726 try:
1695 print('\nStarting the tests...') 1727 print('\nStarting the tests...')
1696 unittest.main(argv = [ sys.argv[0] ] + args.options) 1728 unittest.main(argv = [ sys.argv[0] ] + args.options)
1697 1729
1698 finally: 1730 finally: