diff Tests/Tests.py @ 80:8466dbfcb22b

fix test against dcmtk 3.6.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Apr 2016 13:57:08 +0200
parents 962274ebd797
children 5920954287dd
line wrap: on
line diff
--- 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)