diff Tests/Toolbox.py @ 137:412d5f70447e

testing asynchronous c-move
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 May 2018 21:43:40 +0200
parents 50cd127e5330
children 0682740fcfcb
line wrap: on
line diff
--- a/Tests/Toolbox.py	Wed May 23 10:07:39 2018 +0200
+++ b/Tests/Toolbox.py	Thu May 24 21:43:40 2018 +0200
@@ -212,6 +212,17 @@
             return
         time.sleep(0.1)
 
+def WaitJobDone(orthanc, job):
+    while True:
+        s = DoGet(orthanc, '/jobs/%s' % job) ['State']
+
+        if s == 'Success':
+            return True
+        elif s == 'Failure':
+            return False
+        
+        time.sleep(0.1)
+
 def GetDockerHostAddress():
     route = subprocess.check_output([ '/sbin/ip', 'route' ])
     m = re.search(r'default via ([0-9.]+)', route)