# HG changeset patch # User Alain Mazy # Date 1669131077 -3600 # Node ID 1b1bb862102135ece16b592a7c1f7ffed2db2eb6 # Parent 5386dfd854b350b12ad31fbc6115b918f490ace8 /store: allows overriding CalledAet, Host, Port diff -r 5386dfd854b3 -r 1b1bb8621021 Tests/Tests.py --- a/Tests/Tests.py Tue Oct 11 11:06:47 2022 +0200 +++ b/Tests/Tests.py Tue Nov 22 16:31:17 2022 +0100 @@ -8891,3 +8891,30 @@ j = DoGet(_REMOTE, i['Path']) self.assertEqual('Instance', j['Type']) 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)