diff Tests/Tests.py @ 210:2c50c8f340c2

test_rest_modalities_in_study
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 31 Jan 2019 17:39:24 +0100
parents 2444c9a7c422
children a05cc24f84e5
line wrap: on
line diff
--- 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))