Mercurial > hg > orthanc-tests
comparison Plugins/DicomWeb/Run.py @ 224:f5414254ccaa
test_bitbucket_issue_113
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 26 Feb 2019 18:16:12 +0100 |
parents | f5aca0917d60 |
children | 4d5af1f49cb2 |
comparison
equal
deleted
inserted
replaced
223:f5aca0917d60 | 224:f5414254ccaa |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | |
3 | |
2 | 4 |
3 # Orthanc - A Lightweight, RESTful DICOM Store | 5 # Orthanc - A Lightweight, RESTful DICOM Store |
4 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | 6 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
5 # Department, University Hospital of Liege, Belgium | 7 # Department, University Hospital of Liege, Belgium |
6 # Copyright (C) 2017-2019 Osimis S.A., Belgium | 8 # Copyright (C) 2017-2019 Osimis S.A., Belgium |
444 b = a[0]['00201208']['Value'][0] | 446 b = a[0]['00201208']['Value'][0] |
445 self.assertTrue(isinstance(b, (int, long))) | 447 self.assertTrue(isinstance(b, (int, long))) |
446 self.assertEqual(1, b) | 448 self.assertEqual(1, b) |
447 | 449 |
448 | 450 |
451 def test_bitbucket_issue_113(self): | |
452 # Wrong serialization of PN VR | |
453 # https://bitbucket.org/sjodogne/orthanc/issues/113 | |
454 # https://bitbucket.org/sjodogne/orthanc-dicomweb/issues/2/ | |
455 | |
456 UploadInstance(ORTHANC, 'Encodings/DavidClunie/SCSX1') | |
457 study = '1.3.6.1.4.1.5962.1.2.0.1175775771.5711.0' | |
458 | |
459 # This is the WADO-RS testing | |
460 a = DoGet(ORTHANC, '/dicom-web/studies/%s/metadata' % study) | |
461 self.assertEqual(1, len(a)) | |
462 | |
463 pn = a[0]['00100010'] # Patient name | |
464 self.assertEqual('PN', pn['vr']) | |
465 self.assertEqual(1, len(pn['Value'])) | |
466 self.assertEqual('Wang^XiaoDong', pn['Value'][0]['Alphabetic']) | |
467 self.assertEqual(u'王^小東', pn['Value'][0]['Ideographic']) | |
468 | |
469 # This is the QIDO-RS testing | |
470 a = DoGet(ORTHANC, '/dicom-web/studies') | |
471 self.assertEqual(1, len(a)) | |
472 | |
473 pn = a[0]['00100010'] # Patient name | |
474 self.assertEqual('PN', pn['vr']) | |
475 self.assertEqual(1, len(pn['Value'])) | |
476 self.assertEqual('Wang^XiaoDong', pn['Value'][0]['Alphabetic']) | |
477 self.assertEqual(u'王^小東', pn['Value'][0]['Ideographic']) | |
478 | |
449 | 479 |
450 try: | 480 try: |
451 print('\nStarting the tests...') | 481 print('\nStarting the tests...') |
452 unittest.main(argv = [ sys.argv[0] ] + args.options) | 482 unittest.main(argv = [ sys.argv[0] ] + args.options) |
453 | 483 |