diff Tests/Tests.py @ 220:7b1c976caa9b Orthanc-1.5.5

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 25 Feb 2019 10:57:28 +0100
parents 00e5aeea33dd
children 4087505ddfe3
line wrap: on
line diff
--- a/Tests/Tests.py	Sun Feb 24 08:50:02 2019 +0100
+++ b/Tests/Tests.py	Mon Feb 25 10:57:28 2019 +0100
@@ -4438,7 +4438,7 @@
                       headers = { 'Accept' : 'application/dicom+json' })
             with open(GetDatabasePath(reference), 'rb') as c:
                 d = json.load(c)
-                self.assertEqual(d, b)
+                AssertAlmostEqualRecursive(self, d, b)
                     
         Compare('DummyCT.dcm', 'DummyCT.json')
         Compare('MarekLatin2.dcm', 'MarekLatin2.json')
@@ -4546,9 +4546,9 @@
         self.assertEqual(1, len(DoGet(_REMOTE, '/queries/%s/answers' % a)))
 
         self.assertEqual(0, len(DoGet(_LOCAL, '/instances')))
-        self.assertTrue(MonitorJob(_REMOTE, lambda: DoPost
-                                   (_REMOTE, '/queries/%s/retrieve' % a,
-                                    '{"TargetAet":"ORTHANCTEST","Synchronous":false}')))
+        WaitAllNewJobsDone(_REMOTE, lambda: DoPost
+                           (_REMOTE, '/queries/%s/retrieve' % a,
+                            '{"TargetAet":"ORTHANCTEST","Synchronous":false}'))
 
         # The two studies are matched, as we made the request at the
         # Study level, thus the shared StudyInstanceUID is used as the key
@@ -4562,9 +4562,9 @@
         self.assertEqual(2, len(DoGet(_REMOTE, '/queries/%s/answers' % a)))
         DropOrthanc(_LOCAL)
         self.assertEqual(0, len(DoGet(_LOCAL, '/instances')))
-        self.assertTrue(MonitorJob(_REMOTE, lambda: DoPost
-                                   (_REMOTE, '/queries/%s/retrieve' % a,
-                                    '{"TargetAet":"ORTHANCTEST","Synchronous":false}')))
+        WaitAllNewJobsDone(_REMOTE, lambda: DoPost
+                           (_REMOTE, '/queries/%s/retrieve' % a,
+                            '{"TargetAet":"ORTHANCTEST","Synchronous":false}'))
         self.assertEqual(2, len(DoGet(_LOCAL, '/instances')))
 
         
@@ -4575,9 +4575,9 @@
         self.assertEqual(1, len(DoGet(_REMOTE, '/queries/%s/answers' % a)))
         DropOrthanc(_LOCAL)
         self.assertEqual(0, len(DoGet(_LOCAL, '/instances')))
-        self.assertTrue(MonitorJob(_REMOTE, lambda: DoPost
-                                   (_REMOTE, '/queries/%s/retrieve' % a,
-                                    '{"TargetAet":"ORTHANCTEST","Synchronous":false}')))
+        WaitAllNewJobsDone(_REMOTE, lambda: DoPost
+                           (_REMOTE, '/queries/%s/retrieve' % a,
+                            '{"TargetAet":"ORTHANCTEST","Synchronous":false}'))
         self.assertEqual(1, len(DoGet(_LOCAL, '/instances')))
         
 
@@ -4588,8 +4588,8 @@
         self.assertEqual(1, len(DoGet(_REMOTE, '/queries/%s/answers' % a)))
         DropOrthanc(_LOCAL)
         self.assertEqual(0, len(DoGet(_LOCAL, '/instances')))
-        self.assertTrue(MonitorJob(_REMOTE, lambda: DoPost
-                                   (_REMOTE, '/queries/%s/retrieve' % a,
-                                    '{"TargetAet":"ORTHANCTEST","Synchronous":false}')))
+        WaitAllNewJobsDone(_REMOTE, lambda: DoPost
+                           (_REMOTE, '/queries/%s/retrieve' % a,
+                            '{"TargetAet":"ORTHANCTEST","Synchronous":false}'))
         self.assertEqual(1, len(DoGet(_LOCAL, '/instances')))