comparison Plugins/DicomWeb/Run.py @ 278:514785dacd6d

fix dicomweb tests with debian
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Mar 2020 14:09:15 +0100
parents 95c47602990c
children 7fa5c7a03137
comparison
equal deleted inserted replaced
277:95c47602990c 278:514785dacd6d
448 orthanc = UploadInstance(ORTHANC, 'Issue29.dcm') ['ID'] 448 orthanc = UploadInstance(ORTHANC, 'Issue29.dcm') ['ID']
449 a = DoGet(ORTHANC, '/dicom-web/instances') 449 a = DoGet(ORTHANC, '/dicom-web/instances')
450 self.assertEqual(1, len(a)) 450 self.assertEqual(1, len(a))
451 url = a[0]['00081190']['Value'][0] 451 url = a[0]['00081190']['Value'][0]
452 452
453 prefix = 'http://localhost:8042' 453 prefix = 'http://%s:%s' % (args.server, args.rest)
454 self.assertTrue(url.startswith(prefix)) 454 self.assertTrue(url.startswith(prefix))
455 455
456 b = DoGet(ORTHANC, url[len(prefix):] + '/metadata') 456 b = DoGet(ORTHANC, url[len(prefix):] + '/metadata')
457 self.assertEqual('OB', b[0]['7FE00010']['vr']) 457 self.assertEqual('OB', b[0]['7FE00010']['vr'])
458 self.assertEqual(2, len(b[0]['7FE00010'])) 458 self.assertEqual(2, len(b[0]['7FE00010']))
486 486
487 a = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % study) 487 a = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % study)
488 self.assertEqual(1, len(a)) 488 self.assertEqual(1, len(a))
489 489
490 BASE_URI = '/dicom-web/studies/%s/series/%s/instances/%s/bulk' % (study, series, sop) 490 BASE_URI = '/dicom-web/studies/%s/series/%s/instances/%s/bulk' % (study, series, sop)
491 BASE_URL = 'http://localhost:8042%s' % BASE_URI 491 BASE_URL = 'http://%s:%s%s' % (args.server, args.rest, BASE_URI)
492 492
493 self.assertEqual(2, len(a[0]['60031010']['Value'])) 493 self.assertEqual(2, len(a[0]['60031010']['Value']))
494 CheckBulk(a[0]['60031010']['Value'][0]['60031011'], '%s/60031010/1/60031011' % BASE_URL) 494 CheckBulk(a[0]['60031010']['Value'][0]['60031011'], '%s/60031010/1/60031011' % BASE_URL)
495 CheckBulk(a[0]['60031010']['Value'][1]['60031011'], '%s/60031010/2/60031011' % BASE_URL) 495 CheckBulk(a[0]['60031010']['Value'][1]['60031011'], '%s/60031010/2/60031011' % BASE_URL)
496 CheckBulk(a[0]['7FE00010'], '%s/7fe00010' % BASE_URL) 496 CheckBulk(a[0]['7FE00010'], '%s/7fe00010' % BASE_URL)
577 self.assertEqual(256, a[0]['00280011']['Value'][0]) # Columns 577 self.assertEqual(256, a[0]['00280011']['Value'][0]) # Columns
578 self.assertEqual(16, a[0]['00280100']['Value'][0]) # Bits allocated 578 self.assertEqual(16, a[0]['00280100']['Value'][0]) # Bits allocated
579 579
580 url = a[0]['00081190']['Value'][0] 580 url = a[0]['00081190']['Value'][0]
581 581
582 prefix = 'http://localhost:8042' 582 prefix = 'http://%s:%s' % (args.server, args.rest)
583 self.assertTrue(url.startswith(prefix)) 583 self.assertTrue(url.startswith(prefix))
584 uri = url[len(prefix):] 584 uri = url[len(prefix):]
585 585
586 self.assertRaises(Exception, lambda: DoGetMultipart(ORTHANC, '%s/frames/%d' % (uri, 0))) 586 self.assertRaises(Exception, lambda: DoGetMultipart(ORTHANC, '%s/frames/%d' % (uri, 0)))
587 self.assertRaises(Exception, lambda: DoGetMultipart(ORTHANC, '%s/frames/%d' % (uri, 2))) 587 self.assertRaises(Exception, lambda: DoGetMultipart(ORTHANC, '%s/frames/%d' % (uri, 2)))