# HG changeset patch # User Alain Mazy # Date 1729000380 -7200 # Node ID 5085b83b8eec26cb5bcba31016e648ff63836af7 # Parent 6cdba3322ef0d00f03e44c15a40134c6cfd536da count-resources diff -r 6cdba3322ef0 -r 5085b83b8eec Tests/Tests.py --- a/Tests/Tests.py Mon Oct 14 17:21:47 2024 +0200 +++ b/Tests/Tests.py Tue Oct 15 15:53:00 2024 +0200 @@ -11098,6 +11098,16 @@ self.assertEqual(6, len(a)) + # same query in count-resources + a = DoPost(_REMOTE, '/tools/count-resources', { 'Level' : 'Instance', + 'Query' : { + 'SeriesDescription' : 'T*' + }, + 'ParentPatient' : kneePatientId + }) + + self.assertEqual(6, a["Count"]) + def test_extended_find_filter_metadata(self): if IsOrthancVersionAbove(_REMOTE, 1, 12, 5) and HasExtendedFind(_REMOTE): # TODO: remove HasExtendedFind once find-refactoring branch has been merged @@ -11119,18 +11129,25 @@ DoPut(_REMOTE, '/series/%s/metadata/my-metadata' % brainixEpiSeriesId, 'brainixEpi') # filter on metadata - a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Series', - 'Query' : { - 'SeriesDescription' : 'T*' - }, - 'MetadataQuery' : { - 'my-metadata': '*2*' - } - }) + q = { + 'Level' : 'Series', + 'Query' : { + 'SeriesDescription' : 'T*' + }, + 'MetadataQuery' : { + 'my-metadata': '*2*' + } + } + a = DoPost(_REMOTE, '/tools/find', q) self.assertEqual(1, len(a)) self.assertEqual(kneeT2SeriesId, a[0]) + a = DoPost(_REMOTE, '/tools/count-resources', q) + self.assertEqual(1, a["Count"]) + + + def test_extended_find_expand(self): if IsOrthancVersionAbove(_REMOTE, 1, 12, 5) and HasExtendedFind(_REMOTE): # TODO: remove HasExtendedFind once find-refactoring branch has been merged UploadInstance(_REMOTE, 'Knee/T2/IM-0001-0001.dcm')