diff Tests/Tests.py @ 70:9e7b5809481f Orthanc-1.0.0

test range search
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 Dec 2015 15:59:17 +0100
parents 83fd88230097
children 48740070cbf1 97acfdf0dbce
line wrap: on
line diff
--- a/Tests/Tests.py	Fri Dec 11 15:50:50 2015 +0100
+++ b/Tests/Tests.py	Fri Dec 11 15:59:17 2015 +0100
@@ -1073,6 +1073,21 @@
         i = CallFindScu([ '-k', '0008,0052=SERIES', '-k', '0008,2112' ])  # "ColorTestImageJ" has this sequence tag
         sequences = re.findall('\(0008,2112\)', i)
         self.assertEqual(1, len(sequences))
+
+        # Test range search (buggy if Orthanc <= 0.9.6)
+        i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', 'StudyDate=19980312-' ])
+        studies = re.findall('\(0008,0020\).*?\[\s*(.*?)\s*\]', i)
+        self.assertEqual(2, len(studies))
+        self.assertTrue('20070208' in studies)
+        self.assertTrue('19980312' in studies)
+        i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', 'StudyDate=19980312-19980312' ])
+        studies = re.findall('\(0008,0020\).*?\[\s*(.*?)\s*\]', i)
+        self.assertEqual(1, len(studies))
+        self.assertTrue('19980312' in studies)
+        i = CallFindScu([ '-k', '0008,0052=STUDY', '-k', 'StudyDate=-19980312' ])
+        studies = re.findall('\(0008,0020\).*?\[\s*(.*?)\s*\]', i)
+        self.assertEqual(1, len(studies))
+        self.assertTrue('19980312' in studies)
         
 
     def test_incoming_movescu(self):