Mercurial > hg > orthanc-tests
comparison Plugins/DicomWeb/Run.py @ 131:90e5331ddee9
application/dicom+json is now the default in DICOMweb
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 11 Jan 2018 16:37:21 +0100 |
parents | 50cd127e5330 |
children | e244312964d6 |
comparison
equal
deleted
inserted
replaced
130:50cd127e5330 | 131:90e5331ddee9 |
---|---|
200 self.assertTrue('stow' in sample) | 200 self.assertTrue('stow' in sample) |
201 self.assertTrue('retrieve' in sample) | 201 self.assertTrue('retrieve' in sample) |
202 self.assertTrue('get' in sample) | 202 self.assertTrue('get' in sample) |
203 | 203 |
204 # application/dicom+xml | 204 # application/dicom+xml |
205 self.assertEqual(2, len(re.findall('^--', DoGet(ORTHANC, '/dicom-web/studies'), re.MULTILINE))) | 205 self.assertEqual(2, len(re.findall('^--', DoGet(ORTHANC, '/dicom-web/studies', |
206 self.assertEqual(2, len(re.findall('^--', DoPost(ORTHANC, '/dicom-web/servers/sample/get', | 206 headers = { 'Accept' : 'application/dicom+xml' }), |
207 { 'Uri' : '/studies' }), re.MULTILINE))) | 207 re.MULTILINE))) |
208 self.assertEqual(2, len(re.findall('^--', DoPost | |
209 (ORTHANC, '/dicom-web/servers/sample/get', | |
210 { 'Uri' : '/studies', | |
211 'HttpHeaders' : { 'Accept' : 'application/dicom+xml' } | |
212 }), re.MULTILINE))) | |
208 | 213 |
209 # application/dicom+json | 214 # application/dicom+json |
210 self.assertEqual(1, len(DoGet(ORTHANC, '/dicom-web/studies', headers = { 'Accept' : 'application/json' }))) | 215 self.assertEqual(1, len(DoGet(ORTHANC, '/dicom-web/studies', |
216 headers = { 'Accept' : 'application/dicom+json' }))) | |
217 self.assertEqual(1, len(DoPost(ORTHANC, '/dicom-web/servers/sample/get', | |
218 { 'Uri' : '/studies', | |
219 'HttpHeaders' : { 'Accept' : 'application/dicom+json' }}))) | |
220 | |
221 # application/json | |
222 self.assertEqual(1, len(DoGet(ORTHANC, '/dicom-web/studies', | |
223 headers = { 'Accept' : 'application/json' }))) | |
211 self.assertEqual(1, len(DoPost(ORTHANC, '/dicom-web/servers/sample/get', | 224 self.assertEqual(1, len(DoPost(ORTHANC, '/dicom-web/servers/sample/get', |
212 { 'Uri' : '/studies', | 225 { 'Uri' : '/studies', |
213 'HttpHeaders' : { 'Accept' : 'application/json' }}))) | 226 'HttpHeaders' : { 'Accept' : 'application/json' }}))) |
227 | |
228 # application/dicom+json is the default as of OrthancDicomWeb-0.5 | |
229 self.assertEqual(1, len(DoGet(ORTHANC, '/dicom-web/studies'))) | |
230 self.assertEqual(1, len(DoPost(ORTHANC, '/dicom-web/servers/sample/get', | |
231 { 'Uri' : '/studies' }))) | |
214 | 232 |
215 | 233 |
216 def test_server_stow(self): | 234 def test_server_stow(self): |
217 UploadInstance(ORTHANC, 'Knee/T1/IM-0001-0001.dcm') | 235 UploadInstance(ORTHANC, 'Knee/T1/IM-0001-0001.dcm') |
218 | 236 |