Mercurial > hg > orthanc-tests
changeset 78:b89af51797ff
test_decode_transfer_syntax
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 05 Jan 2016 17:25:11 +0100 |
parents | ac12eee3b463 |
children | 962274ebd797 |
files | Tests/Tests.py |
diffstat | 1 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Tests/Tests.py Tue Jan 05 17:07:32 2016 +0100 +++ b/Tests/Tests.py Tue Jan 05 17:25:11 2016 +0100 @@ -2739,3 +2739,25 @@ self.assertTrue('1.2.840.10008.5.1.4.1.1.128' in t) + def test_decode_transfer_syntax(self): + def Check(t, md5): + i = UploadInstance(_REMOTE, 'TransferSyntaxes/%s.dcm' % t)['ID'] + + if md5 == None: + self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/instances/%s/preview' % i)) + else: + m = ComputeMD5(DoGet(_REMOTE, '/instances/%s/preview' % i)) + self.assertEqual(m, md5) + + Check('1.2.840.10008.1.2.1', 'fae08d5415c4c0cd2cdbae4522408631') + Check('1.2.840.10008.1.2.2', 'f3d9784768b8feb54d6a50b6d5c37682') + Check('1.2.840.10008.1.2.4.50', '496326046974eea718dbc16b997c646b') + Check('1.2.840.10008.1.2.4.51', 'ccbe75909fe5c9f7361b48416a53fc41') + Check('1.2.840.10008.1.2.4.57', '7bbefe11d976b1be4e568915c6a82fc3') + Check('1.2.840.10008.1.2.4.70', '7132cfbc457305b04b59787030c785d2') + Check('1.2.840.10008.1.2.4.80', '6ff51ae525d362e0d04f550a64075a0e') + Check('1.2.840.10008.1.2.4.81', '801579ae7cbf28e604ea74f2c99fa2ca') + Check('1.2.840.10008.1.2.5', '6ff51ae525d362e0d04f550a64075a0e') # RLE, supported since Orthanc 1.0.1 + Check('1.2.840.10008.1.2', 'd54aed9f67a100984b42942cc2e9939b') + Check('1.2.840.10008.1.2.4.90', None) # JPEG-2000 image, not supported + Check('1.2.840.10008.1.2.4.91', None) # JPEG-2000 image, not supported