changeset 27:cde1691838d3

wildcard test
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 Jun 2015 14:44:00 +0200
parents 040f6ef1394a
children 156c7ae164b5
files Tests/Run.py Tests/Tests.py
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Tests/Run.py	Mon Jun 29 13:26:56 2015 +0200
+++ b/Tests/Run.py	Mon Jun 29 14:44:00 2015 +0200
@@ -106,8 +106,9 @@
     f.write(config)
 
 localOrthanc = ExternalCommandThread([ 
-        'Orthanc', CONFIG, #'--verbose'
-        ])
+    'Orthanc', CONFIG, #'--verbose',
+    #'/home/jodogne/Subversion/Orthanc/i/Orthanc', CONFIG, '--verbose'
+])
 
 
 LOCAL = DefineOrthanc(aet = 'ORTHANCTEST',
--- a/Tests/Tests.py	Mon Jun 29 13:26:56 2015 +0200
+++ b/Tests/Tests.py	Mon Jun 29 14:44:00 2015 +0200
@@ -1443,7 +1443,10 @@
         self.assertEqual(0, len(DoGet(_REMOTE, '/patients')))
         self.assertEqual(0, len(DoGet(_REMOTE, '/queries')))
         a = DoPost(_REMOTE, '/modalities/orthanctest/query', { 'Level' : 'Series',
-                                                               'Query' : { 'PatientName' : '*NE*' }})['ID']
+                                                               'Query' : { 
+                                                                   'PatientName' : '*NE*',
+                                                                   'StudyDate' : '*',
+                                                               }})['ID']
         self.assertEqual(1, len(DoGet(_REMOTE, '/queries')))
 
         b = DoGet(_REMOTE, '/queries/%s' % a)
@@ -1456,9 +1459,11 @@
         self.assertEqual('orthanctest', DoGet(_REMOTE, '/queries/%s/modality' % a))
         
         q = DoGet(_REMOTE, '/queries/%s/query?simplify' % a)
-        self.assertEqual(1, len(q))
+        self.assertEqual(2, len(q))
         self.assertTrue('PatientName' in q)
+        self.assertTrue('StudyDate' in q)
         self.assertEqual('*NE*', q['PatientName'])
+        self.assertEqual('*', q['StudyDate'])
 
         self.assertEqual(2, len(DoGet(_REMOTE, '/queries/%s/answers' % a)))