# HG changeset patch # User Alain Mazy # Date 1589286989 -7200 # Node ID b55b959647edcac689e7b7be36cb8cf5c336c801 # Parent 946b2199f481352ca865ca31e79805ca3a4151ef# Parent 192665e6113f6f20dc72ad2ea957c3436a80e202 merge default -> c-get diff -r 192665e6113f -r b55b959647ed Tests/Tests.py --- a/Tests/Tests.py Tue May 12 12:43:25 2020 +0200 +++ b/Tests/Tests.py Tue May 12 14:36:29 2020 +0200 @@ -27,6 +27,7 @@ import pprint import tempfile import unittest +import shutil from PIL import ImageChops from Toolbox import * @@ -5632,3 +5633,42 @@ self.assertEqual('1.2.840.10008.1.2.4.57', GetTransferSyntax(z.read('IMAGES/IM0'))) + + def test_getscu(self): + + # no transcoding required + UploadInstance(_REMOTE, 'DummyCT.dcm') + + if os.path.isdir('/tmp/GETSCU'): + shutil.rmtree('/tmp/GETSCU') + os.makedirs('/tmp/GETSCU') + + subprocess.check_call([ FindExecutable('getscu'), + _REMOTE['Server'], + str(_REMOTE['DicomPort']), + '-aec', 'ORTHANC', + '-aet', 'ORTHANCTEST', # pretend to be the other orthanc + '-k', '0020,000d=1.2.840.113619.2.176.2025.1499492.7391.1171285944.390', + '-k', '0008,0052=STUDY', + '--output-directory', '/tmp/GETSCU/' + ]) + + self.assertTrue(os.path.isfile('/tmp/GETSCU/MR.1.2.840.113619.2.176.2025.1499492.7040.1171286242.109')) + + # transcoding required + # UploadInstance(_REMOTE, 'Formats/JpegLossless.dcm') + + # subprocess.check_call([ FindExecutable('getscu'), + # _REMOTE['Server'], + # str(_REMOTE['DicomPort']), + # '-aec', 'ORTHANC', + # '-aet', 'ORTHANCTEST', # pretend to be the other orthanc + # '-k', '0020,000d=1.2.276.0.7230010.3.1.2.2831176407.19977.1434973482.75580', + # '-k', '0008,0052=STUDY', + # '--output-directory', '/tmp/GETSCU/' + # ]) + + # self.assertTrue(os.path.isfile('/tmp/GETSCU/MR.1.2.276.0.7230010.3.1.4.2831176407.19977.1434973482.75579')) + + +