comparison 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
comparison
equal deleted inserted replaced
137:412d5f70447e 138:0682740fcfcb
1128 self.assertEqual(0, len(DoGet(_LOCAL, '/patients'))) 1128 self.assertEqual(0, len(DoGet(_LOCAL, '/patients')))
1129 CallMoveScu([ '--patient', '-k', '0008,0052=PATIENT', '-k', 'PatientID=none' ]) 1129 CallMoveScu([ '--patient', '-k', '0008,0052=PATIENT', '-k', 'PatientID=none' ])
1130 self.assertEqual(0, len(DoGet(_LOCAL, '/patients'))) 1130 self.assertEqual(0, len(DoGet(_LOCAL, '/patients')))
1131 1131
1132 # 1 Matching patient, track the job 1132 # 1 Matching patient, track the job
1133 a = set(DoGet(_REMOTE, '/jobs')) 1133 self.assertTrue(MonitorJob(_REMOTE, lambda: CallMoveScu([
1134 CallMoveScu([ '--patient', '-k', '0008,0052=PATIENT', '-k', 'PatientID=12345678' ]) 1134 '--patient',
1135 b = set(DoGet(_REMOTE, '/jobs')) 1135 '-k', '0008,0052=PATIENT',
1136 1136 '-k', 'PatientID=12345678'
1137 diff = list(b - a) 1137 ])))
1138 self.assertEqual(1, len(diff))
1139 self.assertTrue(WaitJobDone(_REMOTE, diff[0]))
1140
1141 self.assertEqual(1, len(DoGet(_LOCAL, '/patients'))) 1138 self.assertEqual(1, len(DoGet(_LOCAL, '/patients')))
1142 1139
1143 1140
1144 def test_findscu(self): 1141 def test_findscu(self):
1145 i = UploadInstance(_REMOTE, 'DummyCT.dcm')['ID'] 1142 i = UploadInstance(_REMOTE, 'DummyCT.dcm')['ID']
2633 self.assertEqual(0, len(DoGet(_LOCAL, '/patients'))) 2630 self.assertEqual(0, len(DoGet(_LOCAL, '/patients')))
2634 CallMoveScu([ '--study', '-k', '0008,0052=PATIENT', '-k', 'AccessionNumber=A10003245599' ]) 2631 CallMoveScu([ '--study', '-k', '0008,0052=PATIENT', '-k', 'AccessionNumber=A10003245599' ])
2635 self.assertEqual(0, len(DoGet(_LOCAL, '/patients'))) 2632 self.assertEqual(0, len(DoGet(_LOCAL, '/patients')))
2636 2633
2637 # 1 Matching patient, track the job 2634 # 1 Matching patient, track the job
2638 a = set(DoGet(_REMOTE, '/jobs')) 2635 self.assertTrue(MonitorJob(_REMOTE, lambda: CallMoveScu([
2639 CallMoveScu([ '--study', '-k', '0008,0052=STUDY', '-k', 'AccessionNumber=A10003245599' ]) 2636 '--study',
2640 b = set(DoGet(_REMOTE, '/jobs')) 2637 '-k', '0008,0052=STUDY',
2641 2638 '-k', 'AccessionNumber=A10003245599'
2642 diff = list(b - a) 2639 ])))
2643 self.assertEqual(1, len(diff)) 2640
2644 self.assertTrue(WaitJobDone(_REMOTE, diff[0]))
2645
2646 self.assertEqual(1, len(DoGet(_LOCAL, '/patients'))) 2641 self.assertEqual(1, len(DoGet(_LOCAL, '/patients')))
2647 2642
2648 2643
2649 def test_dicom_to_json(self): 2644 def test_dicom_to_json(self):
2650 i = UploadInstance(_REMOTE, 'PrivateMDNTags.dcm')['ID'] 2645 i = UploadInstance(_REMOTE, 'PrivateMDNTags.dcm')['ID']