diff Tests/Tests.py @ 138:0682740fcfcb

cleanup
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 May 2018 11:08:58 +0200
parents 412d5f70447e
children 5de178abe4d8
line wrap: on
line diff
--- a/Tests/Tests.py	Thu May 24 21:43:40 2018 +0200
+++ b/Tests/Tests.py	Fri May 25 11:08:58 2018 +0200
@@ -1130,14 +1130,11 @@
         self.assertEqual(0, len(DoGet(_LOCAL, '/patients')))
 
         # 1 Matching patient, track the job
-        a = set(DoGet(_REMOTE, '/jobs'))
-        CallMoveScu([ '--patient', '-k', '0008,0052=PATIENT', '-k', 'PatientID=12345678' ])
-        b = set(DoGet(_REMOTE, '/jobs'))
-        
-        diff = list(b - a)
-        self.assertEqual(1, len(diff))
-        self.assertTrue(WaitJobDone(_REMOTE, diff[0]))
-
+        self.assertTrue(MonitorJob(_REMOTE, lambda: CallMoveScu([
+            '--patient',
+            '-k', '0008,0052=PATIENT',
+            '-k', 'PatientID=12345678'
+        ])))
         self.assertEqual(1, len(DoGet(_LOCAL, '/patients')))
 
 
@@ -2635,14 +2632,12 @@
         self.assertEqual(0, len(DoGet(_LOCAL, '/patients')))
 
         # 1 Matching patient, track the job
-        a = set(DoGet(_REMOTE, '/jobs'))
-        CallMoveScu([ '--study', '-k', '0008,0052=STUDY', '-k', 'AccessionNumber=A10003245599' ])
-        b = set(DoGet(_REMOTE, '/jobs'))
+        self.assertTrue(MonitorJob(_REMOTE, lambda: CallMoveScu([
+            '--study',
+            '-k', '0008,0052=STUDY',
+            '-k', 'AccessionNumber=A10003245599'
+        ])))
         
-        diff = list(b - a)
-        self.assertEqual(1, len(diff))
-        self.assertTrue(WaitJobDone(_REMOTE, diff[0]))
-
         self.assertEqual(1, len(DoGet(_LOCAL, '/patients')))