# HG changeset patch # User Sebastien Jodogne # Date 1459771028 -7200 # Node ID 8466dbfcb22b61972387ddde39dc7f1ce9972c81 # Parent 962274ebd797a2b6aca2b44d06596ff52be50c52 fix test against dcmtk 3.6.1 diff -r 962274ebd797 -r 8466dbfcb22b Tests/Tests.py --- a/Tests/Tests.py Mon Mar 07 17:43:33 2016 +0100 +++ b/Tests/Tests.py Mon Apr 04 13:57:08 2016 +0200 @@ -77,6 +77,16 @@ return True +def CompareTags(a, b, tagsToIgnore): + for i in tagsToIgnore: + if i in a: + del a[i] + if i in b: + del b[i] + + return a == b + + def CallFindScu(args): p = subprocess.Popen([ FindExecutable('findscu'), '-P', '-aec', _REMOTE['DicomAet'], '-aet', _LOCAL['DicomAet'], @@ -2556,21 +2566,23 @@ t = DoGet(_REMOTE, '/instances/%s/tags?simplify' % i) with open(GetDatabasePath('PrivateMDNTagsSimplify.json'), 'r') as f: - self.assertEqual(json.loads(f.read()), t) + self.assertTrue(CompareTags(t, json.loads(f.read()), [ + 'ACR_NEMA_2C_VariablePixelDataGroupLength', + 'GenericGroupLength' + ])) t = DoGet(_REMOTE, '/instances/%s/tags' % i) with open(GetDatabasePath('PrivateMDNTagsFull.json'), 'r') as f: - self.assertEqual(json.loads(f.read()), t) + self.assertTrue(CompareTags(t, json.loads(f.read()), [ '7fe0,0000' ])) t = DoGet(_REMOTE, '/instances/%s/tags?simplify' % j) with open(GetDatabasePath('PrivateTagsSimplify.json'), 'r') as f: - a = json.loads(f.read()) - self.assertEqual(a, t) + self.assertTrue(CompareTags(t, json.loads(f.read()), [ + ])) t = DoGet(_REMOTE, '/instances/%s/tags' % j) with open(GetDatabasePath('PrivateTagsFull.json'), 'r') as f: a = json.loads(f.read()) - aa = json.dumps(a).replace('2e+022', '2e+22') tt = json.dumps(t).replace('2e+022', '2e+22') self.assertEqual(aa, tt)