comparison Tests/Tests.py @ 311:07e2adc4aead

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 May 2020 18:29:23 +0200
parents 2565d39dd36c
children e12c8434aa1e
comparison
equal deleted inserted replaced
309:e2647dd96612 311:07e2adc4aead
5780 '-k', '0020,000d=2.16.840.1.113669.632.20.1211.10000357775', 5780 '-k', '0020,000d=2.16.840.1.113669.632.20.1211.10000357775',
5781 '-k', '0008,0052=STUDY', 5781 '-k', '0008,0052=STUDY',
5782 '--output-directory', '/tmp/GETSCU/' 5782 '--output-directory', '/tmp/GETSCU/'
5783 ], env = env) 5783 ], env = env)
5784 5784
5785 self.assertTrue(os.path.isfile('/tmp/GETSCU/MR.1.3.46.670589.11.0.0.11.4.2.0.8743.5.5396.2006120114314079549')) 5785 f1 = '/tmp/GETSCU/MR.1.3.46.670589.11.0.0.11.4.2.0.8743.5.5396.2006120114314079549'
5786 self.assertTrue(os.path.isfile(f1))
5787 with open(f1, 'rb') as f:
5788 self.assertEqual('1.2.840.10008.1.2.1', GetTransferSyntax(f.read()))
5789
5786 CleanTarget() 5790 CleanTarget()
5787 return
5788 5791
5789 # transcoding required 5792 # transcoding required
5790 UploadInstance(_REMOTE, 'Formats/JpegLossless.dcm') 5793 UploadInstance(_REMOTE, 'TransferSyntaxes/1.2.840.10008.1.2.4.50.dcm')
5791 5794
5792 subprocess.check_call([ 5795 subprocess.check_call([
5793 FindExecutable('getscu'), 5796 FindExecutable('getscu'),
5794 _REMOTE['Server'], 5797 _REMOTE['Server'],
5795 str(_REMOTE['DicomPort']), 5798 str(_REMOTE['DicomPort']),
5796 '-aec', 'ORTHANC', 5799 '-aec', 'ORTHANC',
5797 '-aet', 'ORTHANCTEST', # pretend to be the other orthanc 5800 '-aet', 'ORTHANCTEST', # pretend to be the other orthanc
5798 '-k', '0020,000d=2.16.840.1.113669.632.20.1211.10000357775\\1.2.276.0.7230010.3.1.2.2831176407.19977.1434973482.75580', 5801 '-k', '0020,000d=2.16.840.1.113669.632.20.1211.10000357775\\1.2.840.113663.1298.6234813.1.298.20000329.1115122',
5799 '-k', '0008,0052=STUDY', 5802 '-k', '0008,0052=STUDY',
5800 '--output-directory', '/tmp/GETSCU/' 5803 '--output-directory', '/tmp/GETSCU/'
5801 ], env = env) 5804 ], env = env)
5802 5805
5803 os.system('ls -l /tmp/GETSCU') 5806 self.assertTrue(os.path.isfile(f1))
5804 self.assertTrue(os.path.isfile('/tmp/GETSCU/MR.1.3.46.670589.11.0.0.11.4.2.0.8743.5.5396.2006120114314079549')) 5807 with open(f1, 'rb') as f:
5805 self.assertTrue(os.path.isfile('/tmp/GETSCU/MR.1.2.276.0.7230010.3.1.4.2831176407.19977.1434973482.75579')) 5808 self.assertEqual('1.2.840.10008.1.2.1', GetTransferSyntax(f.read()))
5809
5810 # This file is transcoded from "1.2.840.10008.1.2.4.50" to "1.2.840.10008.1.2.1"
5811 # (LittleEndianExplicit is proposed by default by "getscu")
5812 f2 = '/tmp/GETSCU/US.1.2.840.113663.1298.1.3.715.20000329.1115326'
5813 self.assertTrue(os.path.isfile(f2))
5814 with open(f2, 'rb') as f:
5815 self.assertEqual('1.2.840.10008.1.2.1', GetTransferSyntax(f.read()))