Mercurial > hg > orthanc-tests
diff Tests/Tests.py @ 501:1b1bb8621021
/store: allows overriding CalledAet, Host, Port
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 22 Nov 2022 16:31:17 +0100 |
parents | 5386dfd854b3 |
children | 070bc47f4f3e 16ff0375835d |
line wrap: on
line diff
--- 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)