diff Tests/Tests.py @ 510:fb900401be28

fix
author Alain Mazy <am@osimis.io>
date Mon, 20 Mar 2023 18:06:08 +0100
parents 17a74118d73a
children 933fe1bbce4f
line wrap: on
line diff
--- a/Tests/Tests.py	Tue Mar 14 10:34:36 2023 +0100
+++ b/Tests/Tests.py	Mon Mar 20 18:06:08 2023 +0100
@@ -9201,31 +9201,32 @@
         self.assertEqual(j['ID'], i['ID'])
 
     def test_storescu_custom_host_ip_port(self):
-        DropOrthanc(_LOCAL)
-        DropOrthanc(_REMOTE)        
-
-        a = UploadInstance(_REMOTE, 'Knee/T1/IM-0001-0001.dcm')
-
-        # upload to self -> orthanctest shall not receive any content
-        DoPost(_REMOTE, '/modalities/self/store', {  
-            'Resources' : [ a['ID']]
-        })
-        self.assertEqual(0, len(DoGet(_LOCAL, '/instances')))
-
-        # upload to self by overriding it with config from orthanctest -> orthanctest shall receive the content
-        c = DoGet(_REMOTE, '/modalities/orthanctest/configuration')
-        DoPost(_REMOTE, '/modalities/self/store', {  
-            'LocalAet' : 'YOP',
-            'CalledAet' : c['AET'],
-            'Port' : c['Port'],
-            'Host' : c['Host'],
-            'Resources' : [ a['ID']]
-        })
-
-        self.assertEqual(1, len(DoGet(_LOCAL, '/instances')))
-
-        DropOrthanc(_REMOTE)        
-        DropOrthanc(_LOCAL)        
+        if IsOrthancVersionAbove(_REMOTE, 1, 11, 3):
+            DropOrthanc(_LOCAL)
+            DropOrthanc(_REMOTE)        
+
+            a = UploadInstance(_REMOTE, 'Knee/T1/IM-0001-0001.dcm')
+
+            # upload to self -> orthanctest shall not receive any content
+            DoPost(_REMOTE, '/modalities/self/store', {  
+                'Resources' : [ a['ID']]
+            })
+            self.assertEqual(0, len(DoGet(_LOCAL, '/instances')))
+
+            # upload to self by overriding it with config from orthanctest -> orthanctest shall receive the content
+            c = DoGet(_REMOTE, '/modalities/orthanctest/configuration')
+            DoPost(_REMOTE, '/modalities/self/store', {  
+                'LocalAet' : 'YOP',
+                'CalledAet' : c['AET'],
+                'Port' : c['Port'],
+                'Host' : c['Host'],
+                'Resources' : [ a['ID']]
+            })
+
+            self.assertEqual(1, len(DoGet(_LOCAL, '/instances')))
+
+            DropOrthanc(_REMOTE)        
+            DropOrthanc(_LOCAL)        
 
     def test_rle_planar_configuration(self):
         # This test failed in Orthanc <= 1.11.2