changeset 957:df6abc13ad0b

advanced-storage tests for issue #4
author Alain Mazy <am@orthanc.team>
date Tue, 25 Aug 2026 09:31:20 +0200
parents d1259f584f1e
children b3b5f8990265
files NewTests/AdvancedStorage/test_advanced_storage.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NewTests/AdvancedStorage/test_advanced_storage.py	Fri Jul 17 15:05:44 2026 +0200
+++ b/NewTests/AdvancedStorage/test_advanced_storage.py	Tue Aug 25 09:31:20 2026 +0200
@@ -310,6 +310,21 @@
         # self.assertFalse(os.path.exists(info_after_move['Path']))
         self.assertFalse(self.check_file_exists(info_after_move['Path']))
 
+        if self.o.is_plugin_version_at_least("advanced-storage", 0, 3, 2):
+            # move it again to storage B where it is already (https://github.com/orthanc-server/orthanc-advanced-storage/issues/4)
+            self.o.post(endpoint="/plugins/advanced-storage/move-storage",
+                        json={
+                            'Resources': [uploaded_instances_ids[0]],
+                            'TargetStorageId' : 'b'
+                        })
+            
+            # check its path after the move
+            info_after_move2 = self.o.get_json(endpoint=f"/instances/{uploaded_instances_ids[0]}/attachments/dicom/info")
+            self.assertIn('storage-b', info_after_move2['Path'])
+            self.assertEqual("b", info_after_move2['StorageId'])
+            self.assertTrue(self.check_file_exists(info_after_move2['Path']))
+
+
     def test_adopt_abandon(self):
 
         shutil.copy(here / "../../Database/Beaufix/IM-0001-0001.dcm", self.base_test_storage_path + "adopt-files/")