comparison Tests/Tests.py @ 448:63f475995400

Orthanc 1.9.8 is now known as Orthanc 1.10.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 20 Feb 2022 16:58:29 +0100
parents 72be948dfe5c
children 06eea14c5906
comparison
equal deleted inserted replaced
447:72be948dfe5c 448:63f475995400
1248 if IsOrthancVersionAbove(_REMOTE, 1, 9, 1): 1248 if IsOrthancVersionAbove(_REMOTE, 1, 9, 1):
1249 if IsDicomUntilPixelDataStored(_REMOTE): 1249 if IsDicomUntilPixelDataStored(_REMOTE):
1250 self.assertEqual(2, len(DoGet(_REMOTE, '/instances/%s/attachments' % instance))) 1250 self.assertEqual(2, len(DoGet(_REMOTE, '/instances/%s/attachments' % instance)))
1251 self.assertTrue('dicom-until-pixel-data' in DoGet(_REMOTE, '/instances/%s/attachments' % instance)) 1251 self.assertTrue('dicom-until-pixel-data' in DoGet(_REMOTE, '/instances/%s/attachments' % instance))
1252 1252
1253 # New in Orthanc 1.9.8 1253 # New in Orthanc 1.10.0
1254 a = DoGet(_REMOTE, '/instances/%s/attachments?full' % instance) 1254 a = DoGet(_REMOTE, '/instances/%s/attachments?full' % instance)
1255 self.assertEqual(2, len(a)) 1255 self.assertEqual(2, len(a))
1256 self.assertEqual(1, a['dicom']) 1256 self.assertEqual(1, a['dicom'])
1257 self.assertEqual(3, a['dicom-until-pixel-data']) 1257 self.assertEqual(3, a['dicom-until-pixel-data'])
1258 1258
1259 else: 1259 else:
1260 self.assertEqual(1, len(DoGet(_REMOTE, '/instances/%s/attachments' % instance))) 1260 self.assertEqual(1, len(DoGet(_REMOTE, '/instances/%s/attachments' % instance)))
1261 1261
1262 # New in Orthanc 1.9.8 1262 # New in Orthanc 1.10.0
1263 a = DoGet(_REMOTE, '/instances/%s/attachments?full' % instance) 1263 a = DoGet(_REMOTE, '/instances/%s/attachments?full' % instance)
1264 self.assertEqual(1, len(a)) 1264 self.assertEqual(1, len(a))
1265 self.assertEqual(1, a['dicom']) 1265 self.assertEqual(1, a['dicom'])
1266 else: 1266 else:
1267 self.assertEqual(2, len(DoGet(_REMOTE, '/instances/%s/attachments' % instance))) 1267 self.assertEqual(2, len(DoGet(_REMOTE, '/instances/%s/attachments' % instance)))
1268 self.assertTrue('dicom-as-json' in DoGet(_REMOTE, '/instances/%s/attachments' % instance)) 1268 self.assertTrue('dicom-as-json' in DoGet(_REMOTE, '/instances/%s/attachments' % instance))
1269 1269
1270 # New in Orthanc 1.9.8 1270 # New in Orthanc 1.10.0
1271 self.assertRaises(Exception, lambda: DoGet( 1271 self.assertRaises(Exception, lambda: DoGet(
1272 _REMOTE, '/instances/%s/attachments?full' % instance)) 1272 _REMOTE, '/instances/%s/attachments?full' % instance))
1273 1273
1274 self.assertRaises(Exception, lambda: DoPut(_REMOTE, '/patients/%s/attachments/22' % patient, 'hello')) 1274 self.assertRaises(Exception, lambda: DoPut(_REMOTE, '/patients/%s/attachments/22' % patient, 'hello'))
1275 hello = 'hellohellohellohellohellohellohellohellohello' 1275 hello = 'hellohellohellohellohellohellohellohellohello'
8261 8261
8262 self.assertTrue(ImageChops.difference(im1, im2).getbbox() is None) 8262 self.assertTrue(ImageChops.difference(im1, im2).getbbox() is None)
8263 8263
8264 8264
8265 def test_numpy(self): 8265 def test_numpy(self):
8266 # New in Orthanc 1.9.8 8266 # New in Orthanc 1.10.0
8267 a = UploadInstance(_REMOTE, 'Brainix/Flair/IM-0001-0001.dcm')['ID'] 8267 a = UploadInstance(_REMOTE, 'Brainix/Flair/IM-0001-0001.dcm')['ID']
8268 UploadInstance(_REMOTE, 'Brainix/Flair/IM-0001-0002.dcm') 8268 UploadInstance(_REMOTE, 'Brainix/Flair/IM-0001-0002.dcm')
8269 b = UploadInstance(_REMOTE, 'DicomSeg.dcm') ['ID'] 8269 b = UploadInstance(_REMOTE, 'DicomSeg.dcm') ['ID']
8270 d = UploadInstance(_REMOTE, 'Issue124.dcm') ['ID'] 8270 d = UploadInstance(_REMOTE, 'Issue124.dcm') ['ID']
8271 8271