Mercurial > hg > orthanc-tests
comparison Tests/Tests.py @ 324:6164d39399ad
test_findscu_truncation
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 06 Aug 2020 15:55:35 +0200 |
parents | fbf5bdebbba7 |
children | 05f48c19c60d |
comparison
equal
deleted
inserted
replaced
323:fbf5bdebbba7 | 324:6164d39399ad |
---|---|
5821 # (LittleEndianExplicit is proposed by default by "getscu") | 5821 # (LittleEndianExplicit is proposed by default by "getscu") |
5822 f2 = '/tmp/GETSCU/US.1.2.840.113663.1298.1.3.715.20000329.1115326' | 5822 f2 = '/tmp/GETSCU/US.1.2.840.113663.1298.1.3.715.20000329.1115326' |
5823 self.assertTrue(os.path.isfile(f2)) | 5823 self.assertTrue(os.path.isfile(f2)) |
5824 with open(f2, 'rb') as f: | 5824 with open(f2, 'rb') as f: |
5825 self.assertEqual('1.2.840.10008.1.2.1', GetTransferSyntax(f.read())) | 5825 self.assertEqual('1.2.840.10008.1.2.1', GetTransferSyntax(f.read())) |
5826 | |
5827 | |
5828 def test_findscu_truncation(self): | |
5829 # https://groups.google.com/forum/#!msg/orthanc-users/FkckWAHvso8/UbRBAhQ5CwAJ | |
5830 # Fixed by: https://hg.orthanc-server.com/orthanc/rev/2724977419fb | |
5831 UploadInstance(_REMOTE, 'Multiframe.dcm') | |
5832 UploadInstance(_REMOTE, 'ColorTestImageJ.dcm') | |
5833 | |
5834 study = '1.3.46.670589.7.5.8.80001255161.20000323.151537.1' | |
5835 | |
5836 i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', 'StudyInstanceUID' ]) | |
5837 result = re.findall('\(0020,000d\).*?\[(.*?)\]', i) | |
5838 self.assertEqual(2, len(result)) | |
5839 | |
5840 # The "StudyInstanceUID" is set as a list of 5 times the same | |
5841 # study, leading to a string of 249 characters | |
5842 i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', | |
5843 'StudyInstanceUID=%s\\%s\\%s\\%s\\%s' % (( study, ) * 5) ]) | |
5844 result = re.findall('\(0020,000d\).*?\[(.*?)\]', i) | |
5845 self.assertEqual(1, len(result)) | |
5846 | |
5847 # The "StudyInstanceUID" is set as a list of 6 times the same | |
5848 # study, leading to a string of 299 characters. In Orthanc <= | |
5849 # 1.7.2, this is above the value of ORTHANC_MAXIMUM_TAG_LENGTH | |
5850 # == 256, and is thus wiped out by C-FIND SCP. As a | |
5851 # consequence, Orthanc <= 1.7.2 doesn't apply the filter on | |
5852 # "StudyInstanceUID" and returns all the available | |
5853 # studies (i.e. 2). This issue was fixed in Orthanc 1.7.3. | |
5854 i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', | |
5855 'StudyInstanceUID=%s\\%s\\%s\\%s\\%s\\%s' % (( study, ) * 6) ]) | |
5856 result = re.findall('\(0020,000d\).*?\[(.*?)\]', i) | |
5857 self.assertEqual(1, len(result)) | |
5858 |