changeset 629:ed0a51317c0b

fix url starting with '/'
author Alain Mazy <am@osimis.io>
date Wed, 28 Feb 2024 09:57:25 +0100
parents ddf83317c7e0
children e1bc43b5a7d2
files NewTests/Concurrency/test_concurrency.py NewTests/DelayedDeletion/test_delayed_deletion.py NewTests/ExtraMainDicomTags/test_extra_main_dicom_tags.py NewTests/Housekeeper/test_housekeeper.py
diffstat 4 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/NewTests/Concurrency/test_concurrency.py	Thu Feb 22 09:29:09 2024 +0100
+++ b/NewTests/Concurrency/test_concurrency.py	Wed Feb 28 09:57:25 2024 +0100
@@ -151,7 +151,7 @@
         self.assertEqual(0, len(self.o.series.get_all_ids()))
         self.assertEqual(0, len(self.o.instances.get_all_ids()))
 
-        stats = self.o.get_json("/statistics")
+        stats = self.o.get_json("statistics")
         self.assertEqual(0, stats.get("CountPatients"))
         self.assertEqual(0, stats.get("CountStudies"))
         self.assertEqual(0, stats.get("CountSeries"))
@@ -203,7 +203,7 @@
     #         self.assertEqual(2, len(self.o.series.get_all_ids()))
     #         self.assertEqual(50, len(self.o.instances.get_all_ids()))
 
-    #         stats = self.o.get_json("/statistics")
+    #         stats = self.o.get_json("statistics")
     #         self.assertEqual(1, stats.get("CountPatients"))
     #         self.assertEqual(1, stats.get("CountStudies"))
     #         self.assertEqual(2, stats.get("CountSeries"))
@@ -241,7 +241,7 @@
         self.assertEqual(2 * (1 + workers_count * repeat_count), len(self.o.series.get_all_ids()))
         self.assertEqual(50 * (1 + workers_count * repeat_count), len(self.o.instances.get_all_ids()))
 
-        stats = self.o.get_json("/statistics")
+        stats = self.o.get_json("statistics")
         self.assertEqual(1 + workers_count * repeat_count, stats.get("CountPatients"))
         self.assertEqual(1 + workers_count * repeat_count, stats.get("CountStudies"))
         self.assertEqual(2 * (1 + workers_count * repeat_count), stats.get("CountSeries"))
--- a/NewTests/DelayedDeletion/test_delayed_deletion.py	Thu Feb 22 09:29:09 2024 +0100
+++ b/NewTests/DelayedDeletion/test_delayed_deletion.py	Wed Feb 28 09:57:25 2024 +0100
@@ -102,7 +102,7 @@
         while not completed:
             print('-------------- waiting for DelayedDeletion to finish processing')
             time.sleep(1)
-            plugin_status = self.o.get_json("/plugins/delayed-deletion/status")
+            plugin_status = self.o.get_json("plugins/delayed-deletion/status")
             completed = plugin_status["FilesPendingDeletion"] == 0
 
         self.assertTrue(completed)
--- a/NewTests/ExtraMainDicomTags/test_extra_main_dicom_tags.py	Thu Feb 22 09:29:09 2024 +0100
+++ b/NewTests/ExtraMainDicomTags/test_extra_main_dicom_tags.py	Wed Feb 28 09:57:25 2024 +0100
@@ -93,7 +93,7 @@
         self.assertIn("PerformedProtocolCodeSequence", instance["MainDicomTags"])
 
         # reconstruct instance
-        self.o.post(endpoint="/instances/4dc71dc0-6093b5f8-ca67aa8a-07b18ff5-95dbe3c8/reconstruct", json={})
+        self.o.post(endpoint="instances/4dc71dc0-6093b5f8-ca67aa8a-07b18ff5-95dbe3c8/reconstruct", json={})
         instance = self.o.get(endpoint="instances/4dc71dc0-6093b5f8-ca67aa8a-07b18ff5-95dbe3c8").json()
         self.assertIn("Rows", instance["MainDicomTags"])
         self.assertIn("PerformedProtocolCodeSequence", instance["MainDicomTags"])
@@ -106,7 +106,7 @@
 
         # instance level
         r = self.o.post(
-            endpoint="/tools/find",
+            endpoint="tools/find",
             json={
                 "Level": "Instances",
                 "Query": {
@@ -126,7 +126,7 @@
 
         # series level, request a sequence
         r = self.o.post(
-            endpoint="/tools/find",
+            endpoint="tools/find",
             json={
                 "Level": "Series",
                 "Query": {
@@ -149,7 +149,7 @@
         self.o.upload_file(here / "../../Database/Brainix/Flair/IM-0001-0001.dcm")
 
         metadata = self.o.get(
-            endpoint="/dicom-web/studies/2.16.840.1.113669.632.20.1211.10000357775/metadata"
+            endpoint="dicom-web/studies/2.16.840.1.113669.632.20.1211.10000357775/metadata"
         ).json()
 
         self.assertEqual(1, len(metadata))
--- a/NewTests/Housekeeper/test_housekeeper.py	Thu Feb 22 09:29:09 2024 +0100
+++ b/NewTests/Housekeeper/test_housekeeper.py	Wed Feb 28 09:57:25 2024 +0100
@@ -75,7 +75,7 @@
         while not completed:
             print('-------------- waiting for housekeeper to finish processing')
             time.sleep(1)
-            housekeeper_status = cls.o.get_json("/plugins/housekeeper/status")
+            housekeeper_status = cls.o.get_json("plugins/housekeeper/status")
             completed = (housekeeper_status["LastProcessedConfiguration"]["StorageCompressionEnabled"] == True) \
                         and (housekeeper_status["LastChangeToProcess"] == housekeeper_status["LastProcessedChange"])
 
@@ -87,16 +87,16 @@
             filter="Instance"
         )[0]
 
-        instance_info = cls.o.get_json(endpoint=f"/instances/{instance_id}")
+        instance_info = cls.o.get_json(endpoint=f"instances/{instance_id}")
         
         series_id = instance_info["ParentSeries"]
-        series_info = cls.o.get_json(endpoint=f"/series/{series_id}")
+        series_info = cls.o.get_json(endpoint=f"series/{series_id}")
         
         study_id = series_info["ParentStudy"]
-        study_info = cls.o.get_json(endpoint=f"/studies/{study_id}")
+        study_info = cls.o.get_json(endpoint=f"studies/{study_id}")
 
         patient_id = study_info["ParentPatient"]
-        patient_info = cls.o.get_json(endpoint=f"/patients/{patient_id}")
+        patient_info = cls.o.get_json(endpoint=f"patients/{patient_id}")
 
         return instance_info, series_info, study_info, patient_info
 
@@ -105,7 +105,7 @@
     def test_before_after_reconstruction(self):
 
         # make sure it has run once !
-        housekeeper_status = self.o.get_json("/housekeeper/status")
+        housekeeper_status = self.o.get_json("housekeeper/status")
         self.assertIsNotNone(housekeeper_status["LastTimeStarted"])
 
         instance_after, series_after, study_after, patient_after = self.get_infos()