Mercurial > hg > orthanc-tests
changeset 89:74b7b9aed5f8
test TransferSyntax metadata
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Nov 2016 19:44:48 +0100 |
parents | 47a3d6c08413 |
children | afbac3eb28a5 |
files | Tests/Tests.py |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Tests/Tests.py Wed Nov 09 17:16:35 2016 +0100 +++ b/Tests/Tests.py Tue Nov 29 19:44:48 2016 +0100 @@ -923,14 +923,16 @@ self.assertEqual('LastUpdate', m[0]) m = DoGet(_REMOTE, '/instances/%s/metadata' % i) - self.assertEqual(4, len(m)) + self.assertEqual(5, len(m)) self.assertTrue('IndexInSeries' in m) self.assertTrue('ReceptionDate' in m) self.assertTrue('RemoteAET' in m) self.assertTrue('Origin' in m) + self.assertTrue('TransferSyntax' in m) self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/IndexInSeries' % i), 1) self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/Origin' % i), 'RestApi') self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/RemoteAET' % i), '') # None, received by REST API + self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/TransferSyntax' % i), '1.2.840.10008.1.2.4.91') # JPEG2k # Play with custom metadata DoPut(_REMOTE, '/patients/%s/metadata/5555' % p, 'coucou') @@ -1045,14 +1047,16 @@ i = DoGet(_REMOTE, '/instances') self.assertEqual(1, len(i)) m = DoGet(_REMOTE, '/instances/%s/metadata' % i[0]) - self.assertEqual(4, len(m)) + self.assertEqual(5, len(m)) self.assertTrue('IndexInSeries' in m) self.assertTrue('ReceptionDate' in m) self.assertTrue('RemoteAET' in m) self.assertTrue('Origin' in m) + self.assertTrue('TransferSyntax' in m) self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/IndexInSeries' % i[0]), 1) self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/Origin' % i[0]), 'DicomProtocol') self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/RemoteAET' % i[0]), 'STORESCU') + self.assertEqual(DoGet(_REMOTE, '/instances/%s/metadata/TransferSyntax' % i[0]), '1.2.840.10008.1.2.1') def test_incoming_findscu(self): @@ -2768,6 +2772,10 @@ def Check(t, md5): i = UploadInstance(_REMOTE, 'TransferSyntaxes/%s.dcm' % t)['ID'] + if t != '1.2.840.10008.1.2': # This file has no meta header + transferSyntax = DoGet(_REMOTE, '/instances/%s/metadata/TransferSyntax' % i) + self.assertEqual(t, transferSyntax) + if md5 == None: self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/instances/%s/preview' % i)) else: