# HG changeset patch # User Sebastien Jodogne # Date 1589913320 -7200 # Node ID ed20ead1a8b6a6435a410711049aabfe0ea00516 # Parent b8399213b840e2854739ba84ac1f6190d1ffc5f3 test_store_peer_transcoding diff -r b8399213b840 -r ed20ead1a8b6 Tests/Tests.py --- a/Tests/Tests.py Tue May 19 18:25:38 2020 +0200 +++ b/Tests/Tests.py Tue May 19 20:35:20 2020 +0200 @@ -5708,3 +5708,43 @@ self.assertEqual('1.2.840.10008.1.2.4.50', GetTransferSyntax( DoGet(_REMOTE, '/instances/%s/file' % k[0]))) + + def test_store_peer_transcoding(self): + i = UploadInstance(_REMOTE, 'KarstenHilbertRF.dcm')['ID'] + + SYNTAXES = [ + '1.2.840.10008.1.2', + '1.2.840.10008.1.2.1', + #'1.2.840.10008.1.2.1.99', # Deflated Explicit VR Little Endian (cannot be decoded in debug mode if Orthanc is statically linked against DCMTK 3.6.5) + '1.2.840.10008.1.2.2', + '1.2.840.10008.1.2.4.50', + '1.2.840.10008.1.2.4.51', + '1.2.840.10008.1.2.4.57', + '1.2.840.10008.1.2.4.70', + ] + + if HasGdcmPlugin(_REMOTE): + SYNTAXES = SYNTAXES + [ + '1.2.840.10008.1.2.4.80', # This makes DCMTK 3.6.2 crash + '1.2.840.10008.1.2.4.81', # This makes DCMTK 3.6.2 crash + '1.2.840.10008.1.2.4.90', # JPEG2k, unavailable without GDCM + '1.2.840.10008.1.2.4.91', # JPEG2k, unavailable without GDCM + ] + + for syntax in SYNTAXES: + body = { + 'Resources' : [ i ], + } + + if syntax != '1.2.840.10008.1.2.1': + body['Transcode'] = syntax + + self.assertEqual(0, len(DoGet(_LOCAL, '/instances'))) + self.assertEqual(1, len(DoGet(_REMOTE, '/instances'))) + DoPost(_REMOTE, '/peers/peer/store', body, 'text/plain') + self.assertEqual(1, len(DoGet(_LOCAL, '/instances'))) + self.assertEqual(1, len(DoGet(_REMOTE, '/instances'))) + self.assertEqual(syntax, GetTransferSyntax( + DoGet(_LOCAL, '/instances/%s/file' % DoGet(_LOCAL, '/instances') [0]))) + + DropOrthanc(_LOCAL)