# HG changeset patch # User Sebastien Jodogne # Date 1548952764 -3600 # Node ID 2c50c8f340c2f47ab1a299510e0241e29b2b9a3a # Parent c157b2fff551492c5429b0d993879d9954cbded2 test_rest_modalities_in_study diff -r c157b2fff551 -r 2c50c8f340c2 Tests/Tests.py --- a/Tests/Tests.py Fri Jan 25 16:50:17 2019 +0100 +++ b/Tests/Tests.py Thu Jan 31 17:39:24 2019 +0100 @@ -4349,3 +4349,21 @@ self.assertEqual(1, CountDicomResults('PatientSex')) self.assertEqual(1, CountDicomResults('PatientSex=')) self.assertEqual(1, CountRestResults('')) # This check fails on Orthanc <= 1.5.2 (issue 90) + + + def test_rest_modalities_in_study(self): + # Tests a regression that is present in Orthanc 1.5.2 and 1.5.3 + # https://groups.google.com/d/msg/orthanc-users/7lZyG3wpx-M/uOXzAzVCFwAJ + UploadInstance(_REMOTE, 'ColorTestImageJ.dcm') + + a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Study', + 'Query' : { 'ModalitiesInStudy' : 'US' }}) + self.assertEqual(0, len(a)) + + a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Study', + 'Query' : { 'ModalitiesInStudy' : 'US\\CT' }}) + self.assertEqual(1, len(a)) + + a = DoPost(_REMOTE, '/tools/find', { 'Level' : 'Study', + 'Query' : { 'ModalitiesInStudy' : 'CT' }}) + self.assertEqual(1, len(a))