changeset 904:03968d801f3f

fix find_label for MySQL
author Alain Mazy <am@orthanc.team>
date Tue, 14 Apr 2026 15:03:35 +0200
parents 33e17e3581e3
children 6e2e3e6651d4
files Tests/Tests.py Tests/Toolbox.py
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Tests/Tests.py	Tue Apr 14 13:45:12 2026 +0200
+++ b/Tests/Tests.py	Tue Apr 14 15:03:35 2026 +0200
@@ -10437,7 +10437,9 @@
             # The instance has label "a"
             self.assertEqual(1, len(Execute([], 'All')))
             self.assertEqual(1, len(Execute([], 'Any')))
-            if IsOrthancVersionAbove(_REMOTE, 1, 12, 11): # From 1.12.11, 'None' with an empty labels list means "list all resources without any labels"
+            # From 1.12.11, 'None' with an empty labels list means "list all resources without any labels"
+            # But this is currently only implemented in SQLite and PostgreSQL
+            if IsOrthancVersionAbove(_REMOTE, 1, 12, 11) and not HasMySQLIndexPlugin(_REMOTE) and not HasODBCIndexPlugin(_REMOTE): 
                 self.assertEqual(0, len(Execute([], 'None')))
             else:
                 self.assertEqual(1, len(Execute([], 'None')))
--- a/Tests/Toolbox.py	Tue Apr 14 13:45:12 2026 +0200
+++ b/Tests/Toolbox.py	Tue Apr 14 15:03:35 2026 +0200
@@ -484,6 +484,13 @@
     plugins = DoGet(orthanc, '/plugins')
     return ('postgresql-index' in plugins)
 
+def HasMySQLIndexPlugin(orthanc):
+    plugins = DoGet(orthanc, '/plugins')
+    return ('mysql-index' in plugins)
+
+def HasODBCIndexPlugin(orthanc):
+    plugins = DoGet(orthanc, '/plugins')
+    return ('odbc-index' in plugins)
 
 def _GetMaxImageDifference(im1, im2):
     h = ImageChops.difference(im1, im2).histogram()