Mercurial > hg > orthanc-tests
diff Tests/Tests.py @ 332:dc41bfa4bda5
test_move_ambra
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 25 Aug 2020 17:05:34 +0200 |
parents | 8a462f9c5a97 |
children | 695be643b0f4 |
line wrap: on
line diff
--- a/Tests/Tests.py Mon Aug 24 07:29:12 2020 +0200 +++ b/Tests/Tests.py Tue Aug 25 17:05:34 2020 +0200 @@ -5910,3 +5910,54 @@ # Compression must have divided the size of the sent data at least twice self.assertLess(int(job['Content']['Size']), sourceSize / 2) + + + def test_move_ambra(self): + # "Orthanc + Ambra: Query/Retrieve" (2020-08-25) + # https://groups.google.com/g/orthanc-users/c/yIUnZ9v9-Zs/m/GQPXiAOiCQAJ + + UploadInstance(_REMOTE, '2019-06-17-VedranZdesic.dcm') + + self.assertFalse(MonitorJob(_REMOTE, lambda: CallMoveScu([ + '--study', + '-k', 'StudyInstanceUID=' + ]))) + + self.assertFalse(MonitorJob(_REMOTE, lambda: CallMoveScu([ + '--study', + '-k', 'AccessionNumber=', + ]))) + + self.assertFalse(MonitorJob(_REMOTE, lambda: CallMoveScu([ + '--study', + '-k', 'AccessionNumber=', + '-k', 'StudyInstanceUID=' + ]))) + + self.assertEqual(0, len(DoGet(_LOCAL, '/instances'))) + self.assertTrue(MonitorJob(_REMOTE, lambda: CallMoveScu([ + '--study', + '-k', 'AccessionNumber=CT16000988', + '-k', 'StudyInstanceUID=', + ]))) + self.assertEqual(1, len(DoGet(_LOCAL, '/instances'))) + DropOrthanc(_LOCAL) + + self.assertEqual(0, len(DoGet(_LOCAL, '/instances'))) + self.assertTrue(MonitorJob(_REMOTE, lambda: CallMoveScu([ + '--study', + '-k', 'AccessionNumber=CT16000988', + '-k', 'StudyInstanceUID=1.2.840.113619.2.278.3.4194965761.659.1468842739.39', + ]))) + self.assertEqual(1, len(DoGet(_LOCAL, '/instances'))) + DropOrthanc(_LOCAL) + + # This fails on Orthanc <= 1.7.3 + self.assertEqual(0, len(DoGet(_LOCAL, '/instances'))) + self.assertTrue(MonitorJob(_REMOTE, lambda: CallMoveScu([ + '--study', + '-k', 'AccessionNumber=', + '-k', 'StudyInstanceUID=1.2.840.113619.2.278.3.4194965761.659.1468842739.39' + ]))) + self.assertEqual(1, len(DoGet(_LOCAL, '/instances'))) + DropOrthanc(_LOCAL)