changeset 952:ee46f818aa63

clarification
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Aug 2026 17:31:29 +0200
parents 4b44c9333ccc
children b727e7352440
files Tests/CheckHttpServerSecurity.py
diffstat 1 files changed, 14 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Tests/CheckHttpServerSecurity.py	Fri Aug 14 17:27:17 2026 +0200
+++ b/Tests/CheckHttpServerSecurity.py	Fri Aug 14 17:31:29 2026 +0200
@@ -80,55 +80,53 @@
         return None  # Orthanc has not started
 
 
-def Assert(b):
-    if b == None:
-        raise Exception('Bad result')
-    if not b:
+def Assert(expected, actual):
+    if expected != actual:
         raise Exception('Bad result')
 
 
 print('==== TEST 1 ====')
-Assert(IsHttpServerSecure({
+Assert(True, IsHttpServerSecure({
             'RemoteAccessAllowed': False,
             'RegisteredUsers' : { }
             }))
 
 print('==== TEST 2 ====')
-Assert(IsHttpServerSecure({
+Assert(True, IsHttpServerSecure({
             'RemoteAccessAllowed': False,
             'AuthenticationEnabled': False,
             'RegisteredUsers' : { }
             }))
 
 print('==== TEST 3 ====')
-Assert(IsHttpServerSecure({
+Assert(True, IsHttpServerSecure({
             'RemoteAccessAllowed': False,
             'AuthenticationEnabled': True,
             'RegisteredUsers' : { 'orthanc' : 'orthanc' }
             }))
 
-print('==== TEST 4 ====')
-Assert(IsHttpServerSecure({
+print('==== TEST 4 ====')  # Orthanc refuses to start since Orthanc 1.13.0
+Assert(None, IsHttpServerSecure({
             'RemoteAccessAllowed': True
-            }) == None)
+            }))
 
 print('==== TEST 5 (server application scenario) ====')
-Assert(IsHttpServerSecure({
+Assert(False, IsHttpServerSecure({
             'RemoteAccessAllowed': True,
             'AuthenticationEnabled': False,
-            }) == False)
+            }))
 
 print('==== TEST 6 ====')
-Assert(IsHttpServerSecure({
+Assert(True, IsHttpServerSecure({
             'RemoteAccessAllowed': True,
             'AuthenticationEnabled': True,
             'RegisteredUsers' : { 'orthanc' : 'orthanc' }
             }))
 
-print('==== TEST 7 (Docker scenario) ====')
-Assert(IsHttpServerSecure({
+print('==== TEST 7 (Docker scenario) ====')  # Orthanc refuses to start since Orthanc 1.13.0
+Assert(None, IsHttpServerSecure({
             'RemoteAccessAllowed': True,
             'AuthenticationEnabled': True
-            }) == None)
+            }))
 
 print('Success!')