comparison Plugins/DicomWeb/Run.py @ 552:71096a3e3006

test orthanc version
author Alain Mazy <am@osimis.io>
date Sat, 24 Jun 2023 16:08:11 +0200
parents c8d2775f0d02
children 739cad709a8c
comparison
equal deleted inserted replaced
551:c8d2775f0d02 552:71096a3e3006
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): 1694 def test_issue_216(self):
1695 study = UploadInstance(ORTHANC, 'ColorTestImageJ.dcm')['ParentStudy'] 1695 if IsOrthancVersionAbove(ORTHANC, 1, 12, 1):
1696 studyUid = DoGet(ORTHANC, '/studies/%s' % study)['MainDicomTags']['StudyInstanceUID'] 1696 study = UploadInstance(ORTHANC, 'ColorTestImageJ.dcm')['ParentStudy']
1697 1697 studyUid = DoGet(ORTHANC, '/studies/%s' % study)['MainDicomTags']['StudyInstanceUID']
1698 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = { 1698
1699 'accept': 'image/webp, */*;q=0.8, text/html, application/xhtml+xml, application/xml;q=0.9' 1699 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1700 }) 1700 'accept': 'image/webp, */*;q=0.8, text/html, application/xhtml+xml, application/xml;q=0.9'
1701 self.assertEqual(1, len(m)) 1701 })
1702 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0]) 1702 self.assertEqual(1, len(m))
1703 1703 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1704 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = { 1704
1705 'accept': 'text/html, application/xhtml+xml, application/xml, image/webp, */*;q=0.8' 1705 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1706 }) 1706 'accept': 'text/html, application/xhtml+xml, application/xml, image/webp, */*;q=0.8'
1707 self.assertEqual(1, len(m)) 1707 })
1708 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0]) 1708 self.assertEqual(1, len(m))
1709 1709 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1710 # This fails on Orthanc <= 1.12.0 because of the "; q=.2" 1710
1711 # https://bugs.orthanc-server.com/show_bug.cgi?id=216 1711 # This fails on Orthanc <= 1.12.0 because of the "; q=.2"
1712 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = { 1712 # https://bugs.orthanc-server.com/show_bug.cgi?id=216
1713 'accept': 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' 1713 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1714 }) 1714 'accept': 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2'
1715 self.assertEqual(1, len(m)) 1715 })
1716 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0]) 1716 self.assertEqual(1, len(m))
1717 1717 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1718 # This fails on Orthanc <= 1.12.0 because of the ";q=0.9" 1718
1719 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = { 1719 # This fails on Orthanc <= 1.12.0 because of the ";q=0.9"
1720 'accept': 'text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8' 1720 m = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % studyUid, headers = {
1721 }) 1721 'accept': 'text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8'
1722 self.assertEqual(1, len(m)) 1722 })
1723 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0]) 1723 self.assertEqual(1, len(m))
1724 self.assertEqual(studyUid, m[0]['0020000D']['Value'][0])
1724 1725
1725 1726
1726 try: 1727 try:
1727 print('\nStarting the tests...') 1728 print('\nStarting the tests...')
1728 unittest.main(argv = [ sys.argv[0] ] + args.options) 1729 unittest.main(argv = [ sys.argv[0] ] + args.options)