# HG changeset patch # User Alain Mazy # Date 1766144372 -3600 # Node ID 54427d4f4a010d568a8da1abf21cb23763b82405 # Parent c41709fd48e3d3d27b4ddb3b12494e59000f8370 tests for LimitFindResults diff -r c41709fd48e3 -r 54427d4f4a01 Tests/Tests.py --- a/Tests/Tests.py Fri Dec 19 12:01:07 2025 +0100 +++ b/Tests/Tests.py Fri Dec 19 12:39:32 2025 +0100 @@ -11945,7 +11945,7 @@ } ]}) - pprint.pprint(a) + # pprint.pprint(a) # # print(len(a)) # # TODO: we should have something in the response that notifies us that the response is not "complete" # # TODO: we should receive an error if we try to use "since" in this kind of search ? @@ -11990,6 +11990,35 @@ self.assertEqual('20061201', a[1]['MainDicomTags']['StudyDate']) self.assertEqual('20070101', a[2]['MainDicomTags']['StudyDate']) + # check LimitFindResults applies to both findscu and /tools/find + if IsOrthancVersionAbove(_REMOTE, 1, 12, 11): + + allSeries = DoPost(_REMOTE, '/tools/find', { + 'Level' : 'Series', + 'Query' : { + 'PatientName' : '' + }, + 'Expand': False + }) + self.assertEqual(10, len(allSeries)) # because LimitFindResults is 10 + + i = CallFindScu([ '-k', 'QueryRetrieveLevel=Series', '-k', '0010,0010' ]) + patientNames = re.findall(r'\(0010,0010\).*?\[(.*?)\]', i) + self.assertEqual(10, len(patientNames)) # because LimitFindResults is 10 + + allInstances = DoPost(_REMOTE, '/tools/find', { + 'Level' : 'Instance', + 'Query' : { + 'PatientName' : '' + }, + 'Expand': False + }) + self.assertEqual(20, len(allInstances)) # because LimitFindInstances is 20 + + i = CallFindScu([ '-k', 'QueryRetrieveLevel=Instance', '-k', '0010,0010' ]) + patientNames = re.findall(r'\(0010,0010\).*?\[(.*?)\]', i) + self.assertEqual(20, len(patientNames)) # because LimitFindResults is 20 + def test_attachment_range(self): def TestData(path):