changeset 923:9272f0f93ea5

adapt tests for the streaming branch
author Alain Mazy <am@orthanc.team>
date Tue, 09 Jun 2026 10:07:53 +0200
parents f8511b19e114
children f7b5e2a63d01
files NewTests/ExtraMainDicomTags/test_extra_main_dicom_tags.py NewTests/InterruptedDownloads/test_interrupted_downloads.py
diffstat 2 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/NewTests/ExtraMainDicomTags/test_extra_main_dicom_tags.py	Wed Jun 03 16:04:30 2026 +0200
+++ b/NewTests/ExtraMainDicomTags/test_extra_main_dicom_tags.py	Tue Jun 09 10:07:53 2026 +0200
@@ -101,18 +101,12 @@
         self.assertIn("PerformedProtocolCodeSequence", instance["MainDicomTags"])
 
     def get_storage_access_count(self):
-        mm = self.o.get_binary("/tools/metrics-prometheus").decode("utf-8")
+        m = self.o.get_metrics()
         
-        mm = [x.split(" ") for x in mm.split("\n")]
+        count = int(m.get('orthanc_storage_cache_hit_count')) + int(m.get('orthanc_storage_cache_miss_count'))
 
-        count = 0
-        for m in mm:
-            if m[0] == 'orthanc_storage_cache_hit_count':
-                # print(f"orthanc_storage_cache_hit_count = {m[1]}")
-                count += int(m[1])
-            if m[0] == 'orthanc_storage_cache_miss_count':
-                # print(f"orthanc_storage_cache_miss_count = {m[1]}")
-                count += int(m[1])
+        if self.o.get_system()["ApiVersion"] >= 32:  # 1.12.11+ and 32 = streaming branch
+            count += int(m.get('orthanc_dicom_cache_hit_count'))
 
         print(f"storage access count = {count}")
         return count
--- a/NewTests/InterruptedDownloads/test_interrupted_downloads.py	Wed Jun 03 16:04:30 2026 +0200
+++ b/NewTests/InterruptedDownloads/test_interrupted_downloads.py	Tue Jun 09 10:07:53 2026 +0200
@@ -81,7 +81,7 @@
     def test_interrupting_a_download_should_cancel_the_archive_job(self):
         
         # note: there was a regression between 1.12.10 and 1.12.11
-        if self.o.is_orthanc_version_at_least(1, 12, 12):
+        if self.o.is_orthanc_version_at_least(1, 12, 12) and self.o.get_system()["ApiVersion"] >= 32:  # 1.12.11+ and 32 = streaming branch
             self.o.delete_all_content()
             populator = OrthancTestDbPopulator(self.o, studies_count=1, series_count=2, instances_count=200, random_seed=65)
             populator.execute()