Mercurial > hg > orthanc-tests
changeset 141:5de178abe4d8
test_bitbucket_issue_94
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Jul 2018 14:27:03 +0200 |
parents | f52fe6eecb47 |
children | 6d2bfbbd0c2d |
files | Database/Issue94.dcm Tests/Tests.py |
diffstat | 2 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Tests/Tests.py Fri Jun 29 18:04:43 2018 +0200 +++ b/Tests/Tests.py Thu Jul 12 14:27:03 2018 +0200 @@ -3688,3 +3688,28 @@ content1 = DoGet(_REMOTE, '/instances/%s/tags?simplify' % sr1) ['ContentSequence'] content2 = DoGet(_REMOTE, '/instances/%s/tags?simplify' % sr2) ['ContentSequence'] self.assertEqual(str(content1), str(content2)) + + + def test_bitbucket_issue_94(self): + # "a simple instance modification should not modify FrameOfReferenceUID + ..." + # https://bitbucket.org/sjodogne/orthanc/issues/94 + i = UploadInstance(_REMOTE, 'Issue94.dcm')['ID'] + + source = DoGet(_REMOTE, '/instances/%s/attachments/dicom/data' % i) + + modified = DoPost(_REMOTE, '/instances/%s/modify' % i, + { "Replace" : {"PatientID" : "toto"}, "Force": True}) + + anonymized = DoPost(_REMOTE, '/instances/%s/anonymize' % i) + + a = ExtractDicomTags(source, [ 'FrameOfReferenceUID' ]) + self.assertEqual(1, len(a)) + + b = ExtractDicomTags(modified, [ 'FrameOfReferenceUID' ]) + self.assertEqual(1, len(b)) + + c = ExtractDicomTags(anonymized, [ 'FrameOfReferenceUID' ]) + self.assertEqual(1, len(c)) + + self.assertEqual(a, b) # Modified DICOM + self.assertNotEqual(a, c) # Anonymized DICOM