diff Tests/Tests.py @ 119:7ecd26982dd7

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jul 2017 15:57:24 +0200
parents a954c535fef6
children fce08afe6b2d
line wrap: on
line diff
--- a/Tests/Tests.py	Fri Jul 14 11:43:16 2017 +0200
+++ b/Tests/Tests.py	Fri Jul 14 15:57:24 2017 +0200
@@ -1634,7 +1634,10 @@
 
     def test_shanon(self):
         def Anonymize(instance, replacements = {}):
-            return DoPost(_REMOTE, '/instances/%s/anonymize' % instance, { 'Replace' : replacements }, 'application/json')
+            return DoPost(_REMOTE, '/instances/%s/anonymize' % instance, {
+                'Replace' : replacements,
+                'Force' : True,
+            }, 'application/json')
 
         self.assertEqual(0, len(DoGet(_REMOTE, '/instances')))
         u = UploadInstance(_REMOTE, 'DummyCT.dcm')['ID']
@@ -1684,7 +1687,10 @@
 
     def test_shanon_2(self):
         def Modify(instance, replacements = {}):
-            return DoPost(_REMOTE, '/instances/%s/modify' % instance, { 'Replace' : replacements }, 'application/json')
+            return DoPost(_REMOTE, '/instances/%s/modify' % instance, {
+                'Replace' : replacements,
+                'Force': True,
+            }, 'application/json')
 
         self.assertEqual(0, len(DoGet(_REMOTE, '/instances')))
         u = UploadInstance(_REMOTE, 'DummyCT.dcm')['ID']
@@ -3115,7 +3121,8 @@
                 "SOPClassUID" : "test",
                 "SOPInstanceUID" : "myid",
             },
-            "Keep" : [ "StudyInstanceUID", "SeriesInstanceUID" ]
+            "Keep" : [ "StudyInstanceUID", "SeriesInstanceUID" ],
+            "Force" : True
         })
 
         instances = DoGet(_REMOTE, '/instances/')
@@ -3192,7 +3199,7 @@
         UploadInstance(_REMOTE, 'Issue42.dcm')['ID']
         modified = DoPost(_REMOTE,
                           '/patients/da128605-e040d0c4-310615d2-3475da63-df2d1ef4/modify',
-                          '{"Replace":{"PatientID":"Hello","PatientName":"Sample patient name"}}',
+                          '{"Replace":{"PatientID":"Hello","PatientName":"Sample patient name"},"Force":true}',
                           'application/json')
         self.assertTrue('PatientID' in modified)